Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins not picking up the nuget restored packages

I have defined below steps in Jenkins.

Jenkins build configuration

I can see that NuGet is restoring the packages on Jenkins console, but once msbuild starts building, it's failing with below error for all projects in the solution.

Error:

"C:\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): error NETSDK1064: Package Microsoft.EntityFrameworkCore.Analyzers, version 2.1.3 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions."

If I restore the packages using dotnet restore command from command line and trigger the build then its getting passed. So something wrong in restoring the packages from first build step. What I am missing? Thanks in advance!

like image 254
Parashuram Avatar asked Sep 20 '18 04:09

Parashuram


1 Answers

I got this working eventually. I am not sure if it's right or wrong and please correct me in case it's wrong. I am doing the restore using

MSBuild.exe /t:Restore MySln.sln

instead of nuget restore and this is successful now.

like image 91
Parashuram Avatar answered Oct 18 '22 11:10

Parashuram