NuGet 警告 NU1212
方案 1
Invalid project-package combination for Contoso.Library 1.0.0. DotnetToolReference project style can only contain references of the DotnetTool type
问题
DotnetToolReference
项目样式只能引用具有 DotnetTool 包类型的 .NET 工具。 项目样式不是 DotnetToolReference
,或者引用的包不是 DotnetTool
类型。
解决方案
此样式的项目通常不是普通项目,且应使用 dotnet 工具命令来管理 dotnet 工具。
Contoso.Library 不是 DotnetTool
包。
使用 DotnetTool
类型的其他包。
方案 2
Invalid project-package combination for Contoso.Library 1.0.0. DotnetToolReference project style can only contain references of the DotnetTool type
问题
DotnetToolReference
项目样式只能引用具有 DotnetTool 包类型的 .NET 工具。 项目样式不是 DotnetToolReference
,或者引用的包不是 DotnetTool
类型。
解决方案
此样式的项目通常不是普通项目,且应使用 dotnet 工具命令来管理 dotnet 工具。
有问题的项目不是 DotnetToolReference 项目,但包是 DotnetTool 类型。 将 RestoreProjectStyle 更改为 DotnetToolReference。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈