Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 609
sumeet shandilya Avatar asked May 07 '19 11:05

sumeet shandilya


Video Answer


1 Answers

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.

like image 179
Martin Ullrich Avatar answered Oct 27 '22 02:10

Martin Ullrich