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

一个人想着一个人 提交于 2019-12-04 21:44:38

问题


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:

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?


回答1:


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.)



来源:https://stackoverflow.com/questions/43109292/reference-a-net-standard-1-6-library-from-a-net-4-6-2-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!