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

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

问题描述

我有一个针对 netstandard1.6 的本地开发的 nuget 包,该包发布到私人提要.当我尝试将它安装到面向 .NET Framework 4.6.2 的包中时,nuget 告诉我:

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:

您正在尝试将此包安装到以.NETFramework,Version=v4.6.2"为目标的项目中,但该包不包含任何与该框架兼容的程序集引用或内容文件.如需更多信息,请联系软件包作者.

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:

我使用的是 2017 年 3 月 28 日发布的 Visual Studio 2017.

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

我认为这是 .NET Standard 库的全部意义所在?我错过了什么?

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

推荐答案

我相信,我的计划是这将适用于 netstandard2.0 工具 - 但由于 net46x 的一些奇怪之处,它目前不起作用.

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.

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

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

如你所见,在current"中,只有vNext"支持netstandard1.6.你应该可以从 .NET 4.6.2 定位 netstandard1.5 库 - 你真的需要你的包来定位 netstandard1.6 吗?(1.6 中没有 1.5 中没有的很多.)

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天全站免登陆