从.net 4.6.2库引用.NET Standard 1.6库 [英] Reference a .NET Standard 1.6 library from a .net 4.6.2 library

查看:93
本文介绍了从.net 4.6.2库引用.NET Standard 1.6库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自家种植的nuget软件包,其目标是将netstandard1.6发布到私有供稿。当我尝试将其安装到针对.NET Framework 4.6.2的软件包时,nuget告诉我:



您正试图将此软件包安装至针对 .NETFramework,Version = v4.6.2',但程序包不包含任何与该框架兼容的程序集引用或内容文件。有关更多信息,请与软件包作者联系。



该软件包的依赖项列表如下:





我正在使用Visual Studio 2017,2017年3月28日发布。



<我以为这就是.NET标准库的重点?我想念的是什么?

解决方案

我相信该计划是可以与netstandard2.0工具一起使用的,但是它不会。



netstandard和.NET Framework版本之间的映射有两个文档:





如您所见,在当前中,只有 vNext支持netstandard1.6。不过,您应该可以从.NET 4.6.2中定位一个netstandard1.5库-您实际上是否需要将包定位到netstandard1.6? (1.6中没有很多,而1.5中没有。)


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?

解决方案

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:

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

这篇关于从.net 4.6.2库引用.NET Standard 1.6库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆