Missing required property 'OutputPath' for project type 'PackageReference'

南笙酒味 提交于 2020-01-16 04:28:05

问题


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"'

but i'm getting error saying

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.

I tried

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.

I'm expecting all the NuGet packages to get installed as we 'Restore NuGet Packages' in Visual Studio.


回答1:


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.



来源:https://stackoverflow.com/questions/56021192/missing-required-property-outputpath-for-project-type-packagereference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!