Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference a .NET Standard 1.6 library from a .net 4.6.2 library

I have a home grown nuget package that targets netstandard1.6 published to a private feed. When I try to install it into a package that targets .NET Framework 4.6.2, nuget tells me:

You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

The dependency list for the package looks like:

enter image description here

I'm using Visual Studio 2017, March 28 2017 release.

I thought this was the whole point of the .NET Standard library? What am I missing?

like image 320
Chris Avatar asked Mar 30 '17 05:03

Chris


1 Answers

The plan is that this will work with netstandard2.0 tooling, I believe - but it doesn't work at the moment due to some oddities around net46x.

There are two docs for the mappings between netstandard and .NET framework versions:

  • Aspirational .NET Standard 2.0 tooling
  • Current tooling

As you can see, in "current", only "vNext" supports netstandard1.6. You should be okay targeting a netstandard1.5 library from .NET 4.6.2 though - do you actually need your package to target netstandard1.6? (There's not a lot in 1.6 that's not in 1.5.)

like image 190
Jon Skeet Avatar answered Nov 10 '22 01:11

Jon Skeet