c# - 将 .NetStandard 2.0 Nuget 包安装到 VS2015 Net 4.6.1 项目中

标签 c# visual-studio nuget .net-standard

我正在尝试将一个以 .NetStandard 2.0 (Microsoft.Extensions.Logging.Abstractions) 为目标的 Nuget 包安装到 Visual Studio 2015 中的 Net 4.6.1 项目中。但是,虽然框架应该兼容,但它不兼容相当不错:

Install-Package : Could not install package 'Microsoft.Extensions.Logging.Abstractions 2.0.0'. You are trying to 
install this package into a project that targets '.NETFramework,Version=v4.6.1', 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.
At line:1 char:1
+ Install-Package Microsoft.Extensions.Logging.Abstractions

我已按照此处列出的步骤操作:Entity Framework Core 2.0 on .NET 4.6.1

所以我安装了“NETStandard.Library.NETFramework”包,并添加了

<PropertyGroup>
  <PackageTargetFallback>netstandard2.0</PackageTargetFallback>
</PropertyGroup>

到csproj。但是,没有运气 - 仍然是同样的问题。

有什么方法可以将 NetStandard 2.0 包安装到我的项目中(无需升级 VS 或安装任何 Net Core 目标包等)?

谢谢

最佳答案

使用以下支持引用 .NET Standard 2.0 包:

在使用 .NET Standard 2.0 库时仍然存在一些错误,尤其是在混合使用 .NET Standard < 2.0 和 2.0 库时,但这些更新提供了基本支持。

关于c# - 将 .NetStandard 2.0 Nuget 包安装到 VS2015 Net 4.6.1 项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46788323/

相关文章:

c# - 异步不适用于 EF + 工作单元 + Repo

c# - 将日期时间重新格式化为 2014 年 11 月 7 日

c# - 我可以从引用源重建 .NET 类吗?

javascript - Visual Studio (Express 2013 for Web) 中 JS 文件的更多字体颜色

c# - asp.net 中的日期选择器

visual-studio - 使用 Visual Studio for Mac 在 Azure 存储上出现错误 System.DllNotFoundException : fusion. dll

c - 如何使我的程序 "forget"成为我在键盘上按下的字母?

azure - 管道从 azure 工件恢复 nuget 包

xsd - IntelliSense 支持在 Visual Studio 中编辑 NuGet 规范

nuget - 本地NuGet软件包依赖关系-是否从正式的Nuget供稿中解析?