c# - The type 'IEnumerable<>' is defined in an assembly that is not referenced. System.Runtime -


i have asp.net 5 web application references class library.

that class library use entity framework 7 perform query.

public ienumerable<member> getmemberybyfirstname(string firstname) {     var members = _context.members.where(m => m.firstname.contains(firstname));     return memebers; } 

but compile error

the type 'ienumerable<>' defined in assembly not referenced. must add reference assembly 'system.runtime, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a'. *

i figured out how wanted info available.

it's quite complicated , revolves around project.json.

the short answer changed project.json in class library

{     "version": "1.0.0-*",     "description": "member.business class library",     "authors": [ "bryan" ],     "tags": [ "" ],     "projecturl": "",     "licenseurl": "",     "frameworks": {         "dnx451": { },         "dnxcore50": {               "dependencies": {                "microsoft.csharp": "4.0.1-beta-23516"             }         }     },     "dependencies": {         "entityframework.microsoftsqlserver": "7.0.0-rc1-final",         "member.datalayer": "1.0.0-*",         "member.domain": "1.0.0-*",         "system.collections": "4.0.11-beta-23516",         "system.linq": "4.0.1-beta-23516",         "system.runtime": "4.0.21-beta-23516",         "system.threading": "4.0.11-beta-23516"     } } 

much more detail can found here - http://nodogmablog.bryanhogan.net/2016/01/the-type-is-defined-in-an-assembly-that-is-not-referenced-system-runtime/


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -