问题
I have defined below steps in Jenkins.
I could see the nuget restoring the packages on jenkins console but once msbuild starts building its 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!!
回答1:
I got this working eventually. I am not sure its it right or wrong and please correct me in case its wrong. I am doing restore using "MSBuild.exe /t:Restore MySln.sln" instead of nuget restore and this is success now
来源:https://stackoverflow.com/questions/52417629/jenkins-not-picking-up-the-nuget-restored-packages