I want to create a library for ASP.NET Core in VS17 that uses System.Data.SqlClient for accesing database. I picked .NET Core Library Class. The problem is that I'm getting errors like :
CS0012 The type 'Object' is defined in an assembly that is not >referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, >Culture=neutral, PublicKeyToken=b77a5c561934e089'.
On stackoverflow I found a thread with advice to add NuGet package : Microsoft.NETCore.Portable.Compatibility, but then it just throws following exception :
FileNotFoundException: Could not load file or assembly 'System.Data, >Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
I tried getting other library types like .NET Standard or .NET Framework, but I am also getting errors e.g. some types from standard System.Data.SqlClient are unavailable.
Is there a way to create a library for ASP.NET Core that uses SqlClient for accesing database then?