c# - Creating a library for ASP.NET Core, but using System.Data.SqlClient -
i want create library asp.net core in vs17 uses system.data.sqlclient accesing database. picked .net core library class. problem i'm getting errors :
cs0012 type 'object' defined in assembly not >referenced. must add reference assembly 'mscorlib, version=4.0.0.0, >culture=neutral, publickeytoken=b77a5c561934e089'.
on stackoverflow found thread advice add nuget package : microsoft.netcore.portable.compatibility, throws following exception :
filenotfoundexception: not load file or assembly 'system.data, >version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089'.
i tried getting other library types .net standard or .net framework, getting errors e.g. types standard system.data.sqlclient unavailable.
is there way create library asp.net core uses sqlclient accesing database then?
i had similar problem of your. try run dotnet restore myprojectname on package manager console or on command prompt.
in way packages , sdk's on project download , reference problems go away.
Comments
Post a Comment