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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With