[英]Nuget won't install package, due to a mismatch in the targeted framework
我有一个引用python
package 的 C# 项目。 该项目是在 Visual Studio 2017 中开发的,目标是 .NET 4.5.2。 我现在正在更新项目,目标是 .NET 4.7.2。 I also want to update the python
package to a later version (one which has Python 3.9 and not Python 3.5).
当我尝试更新 package 时。 我收到一条错误消息,说 package 无法安装在针对 .NET 4.7.2 的项目中,因为它没有引用任何 .NET 4.7.2 程序集或内容。
所以很明显,我不能将 .NET 4.7.2 与这个 package 一起使用。 问题是 - 我可以将哪个版本的 .NET 与这个 package 一起使用? 如何判断 Nuget package 支持哪个 .NET 框架?
If you start off going to the package page on nuget.org, as posted in the comments to your question: https://www.nuget.org/packages/python/3.9.9
在右侧,有一个名为“在 NuGet Package Explorer 中打开”的链接,它将带您到这里: https://nuget.info/packages.python
这使您可以检查 package 的内容。
现在,您需要了解 NuGet 的工作原理,但在 package 中的 3 个顶级文件夹中,仅build/
匹配 NuGet 约定。 这里唯一的文件是build/native/python.props
,它符合NuGet 的build/{tfm}/{packageid}.[props|targets]
约定。
所以这个package只兼容native
TFM,即C++,不是.NET项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.