c# - Add Assembly to Class Library in VS 2015 -
have used visual studio years , trying create first project in visual studio 2015.
i have create mvc project , interrested in adding new project act data layer. lets call project myproj. created new web class library called myproj.data. installed newest entityframework (6.1.3) using nuget project.
now want create class should act entitytypeconfiguration like:
public class gadgetconfiguration : entitytypeconfiguration<gadget> { .... } problem entitytypeconfiguration not recognised. reharper says: reference 'entityframework' , use 'system.data.entity.modelconfiguration.entitytypeconfiguration'
problem (as far see it) in folder references -> .net platform can see entityframework. should referenced. cannot find system.data.entity in references.
when try add reference, assemblies tab 'no items found'. if click "browse..." button told "project not have target frameworks specified".
then tried adding v4.5 myproj.data.xproj file (under ...) didn't change thing.
then changed frameworks part of project.json file from
"frameworks": { "dotnet": { } } to
"frameworks": { "dotnet": { }, "dnx451": { "frameworkassemblies": { "system.data": "4.0.0.0", "system.data.entity": "4.0.0.0" } } now can see system.data , system.data.entity. can add more assemblies references now. still cannot use them in classes. neither typing
using entityframework or
using system.data or referencing directly like
public class gadgetconfiguration : system.data.entity.modelconfiguration.entitytypeconfiguration<gadget> how can reference/use needed assembly?
okay, solution simple... created web class library used when want create class library nuget package. not wanted (you couldn't know initial description).
so solution drop web class library , create windows class library instead. works!
Comments
Post a Comment