I have defined below steps in Jenkins
.
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!
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.
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