[英]How to update to .NETStandard 2.0 NuGet Package
I've a good old .NET Framework 4.7 Class Library in Visual Studio 2015 currently using Microsoft.Extensions.Configuration
NuGet package version 1.1.2 . 我在Visual Studio 2015中有一个很好的旧.NET Framework 4.7 类库 ,目前使用的是
Microsoft.Extensions.Configuration
NuGet包版本1.1.2 。 I'm trying to update this to version 2.0 , but I'm getting this error: 我正在尝试将此更新到2.0版 ,但我收到此错误:
Microsoft.Extensions.Configuration 2.0.0'.
Microsoft.Extensions.Configuration 2.0.0'。 You are trying to install this package into a project that targets '.NETFramework,Version=v4.7', but the package does not contain any assembly references or content files that are compatible with that framework.
您正在尝试将此软件包安装到以“.NETFramework,Version = v4.7”为目标的项目中,但该软件包不包含任何与该框架兼容的程序集引用或内容文件。 For more information, contact the package author.
有关更多信息,请与软件包作者联系。
I see that the new version only supports .NETStandard 2.0 . 我看到新版本仅支持.NETStandard 2.0 。 Do I have to convert all my project to either .NET Core or .NET Standard in Visual Studio 2017 ?
我是否必须将所有项目转换为Visual Studio 2017中的 .NET Core或.NET Standard ?
.NET Framework versions 4.6.1 and higher do support .NET Standard 2.0+, but only when using new tooling. .NET Framework 4.6.1及更高版本支持.NET Standard 2.0+,但仅限于使用新工具时。 Make sure you update to VS 2017 version 15.3.0 or higher and have the .NET Core SDK 2.0.0 installed and no
global.json
in your solution's directory hierarchy pinning a lower SDK version. 确保您更新到VS 2017版本15.3.0或更高版本并安装了.NET Core SDK 2.0.0,并且解决方案的目录层次结构中没有
global.json
固定较低的SDK版本。
You may also need to install the .NET Core workload in VS 2017 您可能还需要在VS 2017中安装.NET Core工作负载
Yes you have to convert your project to .Net standard 2.0 to use the Microsoft.Extensions.Configuration 2.0.0 package. 是的,您必须将项目转换为.Net标准2.0才能使用Microsoft.Extensions.Configuration 2.0.0软件包。
Check out the below link for .Net standard 2.0 supported .Net framework version as of now the, .Net standard 2.0 supports only up to .Net framework 4.6.1 查看.Net标准2.0支持的.Net框架版本的以下链接,截至目前,.Net标准2.0仅支持.Net框架4.6.1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.