简体   繁体   English

Nuget package 未安装 in.Net Framework

[英]Nuget package not installing in .Net Framework

I have created .net standard library project and I have created nuget package for this library, Now I need to install this package in both application.Net Core and.Net Framework4.5. I have created .net standard library project and I have created nuget package for this library, Now I need to install this package in both application.Net Core and.Net Framework4.5. Working fine in.Net Core but while installing.Net framework project it was showing below exception.在.Net Core 中工作正常,但在安装.Net 框架项目时它显示在异常之下。

Blockquote You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2', but the package does not contain any assembly references or content files that are compatible with that framework. Blockquote 您正在尝试将此 package 安装到以“.NETFramework,Version=v4.5.2”为目标的项目中,但 package 不包含任何与该框架兼容的程序集引用或内容文件。 For more information, contact the package author.如需更多信息,请联系 package 作者。 Blockquote块引用

Please let me know the right approach to resolve this.请让我知道解决此问题的正确方法。

The library that you have created targets .NET Standard 2.0, as stated in your tags.如标签中所述,您创建的库以 .NET 标准 2.0 为目标。 .NET Framework 4.5.2 does only implement .NET Standard up to version 1.2, that is why the assemblies are not compatible. .NET 框架 4.5.2 仅实现 .NET 标准版本 1.2,这就是组件不兼容的原因。

You should change your library to a .NET Standard version that is implemented by both .NET Core and .NET Framework or upgrade your .NET Framework version accordingly.您应该将您的库更改为由 .NET Core 和 .NET 框架实现的 .NET 标准版本,或者相应地升级您的 Z303CB0EF9EDB9082AZ61BBBE5825 框架版本。

You can find the version mappings here , credits to @Matt Ward for providing the source.您可以在此处找到版本映射,感谢 @Matt Ward 提供源代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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