Azure DevOps private build agent is trying to download older dotnet version packages as part of the Nuget restore task which are not used in project anymore and failing in a specific pipeline only. The same build agent has no issues in any other pipelines for the same nuget restore task. My question is that whether a specific pipeline can cache nuget restore separately and failing because of that..?
-
can you share at which specific task within the pipeline it is failing and the error message?devcrp– devcrp2020-05-27 14:16:47 +00:00Commented May 27, 2020 at 14:16
-
Already mentioned: Nuget Restore Task and the error message says: ##[error]The nuget command failed with exit code(1) and error(Errors in packages.config projects Unable to find version '9.3.0' of package 'Edge.js'. We are not using this version of edge.js anymore but somehow it is trying to download older packages and this package version doesnt exist in nuget repo so its failing.Arghya– Arghya2020-05-27 17:29:16 +00:00Commented May 27, 2020 at 17:29
1 Answer
Azure Devops private build agent failing at nuget restore task
According to the error message in your commemt:
Errors in packages.config projects Unable to find version '9.3.0' of package 'Edge.js'. We are not using this version of edge.js anymore but somehow it is trying to download older packages and this package version doesnt exist in nuget repo
nuget is restoring a nuget package that you no longer use, and this package version does not exist in nuget repo, so it fails.
To resolve this issue, we need to remove that package from our project. If you have packages.config, please remove below item in it:
<package id="Edge.js" version="9.3.0" targetFramework="net461" />
If your project is .net core, you need open your project file .csproj file and remove below item in it:
<PackageReference Include="Edge.js" Version="9.3.0" />
If you have already done this, then you need to check the repo and branch associated with your current pipeline to confirm that the source code on the branch of the associated repo is updated.
If above answer not resolved your question, please share more info about your build definition and the package info in your project.
Hope this helps.