我在 Visual Studio 2015 中有一个很好的 .NET Framework 4.7 类库 目前正在使用 Microsoft.Extensions.Configuration
NuGet package version 1.1.2 .我正在尝试将其更新为 version 2.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. For more information, contact the package author.
我看到新版本只支持.NETStandard 2.0。我是否必须在 Visual Studio 2017 中将我的所有项目转换为 .NET Core 或 .NET Standard?
最佳答案
.NET Framework 4.6.1 及更高版本支持 .NET Standard 2.0+,但仅在使用新工具时支持。确保更新到 VS 2017 版本 15.3.0 或更高版本,并安装了 .NET Core SDK 2.0.0,并且解决方案的目录层次结构中没有 global.json
固定较低的 SDK 版本。
您可能还需要在 VS 2017 中安装 .NET Core 工作负载
关于c# - 如何更新到 .NETStandard 2.0 NuGet 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45993891/