简体   繁体   中英

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 . I'm trying to update this to version 2.0 , but I'm getting this error:

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. For more information, contact the package author.

I see that the new version only supports .NETStandard 2.0 . Do I have to convert all my project to either .NET Core or .NET Standard in Visual Studio 2017 ?

.NET Framework versions 4.6.1 and higher do support .NET Standard 2.0+, but only when using new tooling. 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.

You may also need to install the .NET Core workload in VS 2017

Yes you have to convert your project to .Net standard 2.0 to use the Microsoft.Extensions.Configuration 2.0.0 package.

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 standard 2.0 supported api

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM