I want to create data small data access library for Sql Server that wraps standard Sql Client classes, and publish it to NuGet. I want to use this NuGet package both in standard and .Net core apps.
I created class library project with some data access code (it uses System, System.Core, and System.Data) and published it to nugget. I have added System, System.Core, and System.Data as NuGet framework dependencies.
UPDATE - described problems both in RC1 and RC2
In RC1 version it works with 4.6 framework, but I had to remove DNX 5 from package.json.
In RC2 version it works with ASPNET Core (.Net Framework) projects, but when I create ASPNET Core (.Net Core), compilation fails:
Error NU1002 The dependency does not support framework .NETCoreApp,Version=v1.0.
Is there any way to create nugget package that works in both versions?
Since .NET Core 1.0 was just released this week, I'll answer the question in the context of the latest version of the framework.
If you are attempting to target both ASP.NET Core 1.0 and .NET 4.5 you have to define both frameworks separately, including all dependencies each framework build would require.
Here is an example project.json file for a class library project that targets .NET Core Standard 1.5, ASP.NET Core 1.0, .NET 4.5, and .NET 4.0 and has a dependency on the System.Linq.Expressions namespace: