缺少项目类型"PackageReference"的必需属性"OutputPath" [英] Missing required property 'OutputPath' for project type 'PackageReference'
问题描述
我正在尝试通过Jenkins Pipeline运行以下命令
I'm trying to run the following command thru Jenkins Pipeline
bat 'nuget restore mySolution.sln -MSBuildPath "C:\\Program Files (x86)\\MSBuild\\14.0\\Bin"'
但是我说错了
无效的恢复输入.缺少所需的属性"OutputPath" 项目类型"PackageReference".输入文件:C:\ Program Files (x86)\ Jenkins \ workspace \ My Project Build Pipeline \ myProject \ myProject.csproj.
Invalid restore input. Missing required property 'OutputPath' for project type 'PackageReference'. Input files: C:\Program Files (x86)\Jenkins\workspace\My Project Build Pipeline\myProject\myProject.csproj.
我尝试了
bat label: '', script: '"C:\\Package tools\\nuget.exe" restore "C:\\Program Files (x86)\\Jenkins\\workspace\\My Project Build Pipeline\\myProject\\myProject.csproj" -MSBuildPath "C:\\Program Files (x86)\\MSBuild\\14.0\\Bin"' // Restore packages.
我希望在我们在Visual Studio中还原NuGet程序包"时安装所有NuGet程序包.
I'm expecting all the NuGet packages to get installed as we 'Restore NuGet Packages' in Visual Studio.
推荐答案
显然,您正在使用VS 2015工具(MSBuild 14)和/或较旧的nuget.exe(< 4.0.0)来使用PackageReference
引用NuGet包的方式.使用更新的工具(Nuget 4 +,VS/Build Tools 2017+)来解决此问题.
Apparently you are using VS 2015 tools (MSBuild 14) and/or an older nuget.exe (< 4.0.0) to work on projects using the PackageReference
way of referencing NuGet Packages. Use newer tools (Nuget 4+, VS / Build Tools 2017+) to fix this issue.
这篇关于缺少项目类型"PackageReference"的必需属性"OutputPath"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!