.net - C++ CLR NuGet 包错误:安装失败
问题描述
所以我正在使用 C++ 来处理一个项目,并且我创建了一个 GUI。我尝试使用 NuGet 来代替包但是,它不断出现此错误:
Could not install package 'MetroModernUI 1.4.0'. You are trying to install this package into a project that targets 'native,Version=v0.0', 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.
我在这里找到了一个链接来帮助我解决这个问题。但是,第 2 步出现了另一个问题。这是链接和错误:
Install failed. Rolling back...
Package 'NuGet.CommandLine.5.8.1' does not exist in project 'Project Name'
Package 'NuGet.CommandLine.5.8.1' does not exist in folder '<path>\packages'
该目录中甚至不存在 Package 文件夹。有人请帮助我,因为在尝试使用 NuGet 代替包时,上一个错误中也出现了该错误,这里是:
Install failed. Rolling back...
Package 'MetroModernUI.1.4.0' does not exist in project 'Project Name'
Package 'MetroModernUI.1.4.0' does not exist in folder '<path>\packages'
解决方案
脚步
1首先,通过Nuget Package Manager UI将NuGet.CommandLine版本安装4.7.3
到您的 clr 项目中。
2)之后,在新创建的packages.config
文件下手动添加
<package id="MetroModernUI" version="1.4.0"/>
然后,重建您的项目以恢复 nuget 包MetroModernUI
。
您可以在下面找到nuget包安装到您的项目中<Solution_Folder>\packages\MetroModernUI.1.4.0.0
3)然后右键单击References --> Add Reference --> Browse然后添加
<Solution_Folder>\packages\MetroModernUI.1.4.0.0\lib\net\MetroFramework.dll
或该文件夹中的任何其他人。
您应该注意 clr 项目无法通过 nuget 自动引用网络程序集 dll。您应该手动添加它们。
所有这些步骤都将帮助你得到你想要的。
推荐阅读
- javascript - 我想在一定数量的 li 和相同的 ul 类之后添加一个查看更多按钮
- django - Django rest update one field
- dart - Dart json.encode 返回带有不带引号的键值的 json 字符串
- vhdl - 如何编写 VHDL 测试平台
- vba - 检查命名范围excel vba中是否有更改的单元格
- azure - 比较:Azure Functions 与 Azure Batch
- javascript - 查找线段和贝塞尔曲线交点的程序
- git - Git Credential Manager 如何区分不同的服务器?
- django - Django:获取唯一的字段并计算它们在表格中出现的次数
- python - 正则表达式以匹配以文本格式编写的年龄