Skip to content

Dotnet tool restore fails randomly #27161

Discussion options

You must be logged in to vote

Turns out this is not an isolated problem and many people have experienced it.

If you are one of us, I found a solution mentioned in this thread - actions/setup-dotnet#155

The solution is this step:

- name: Clean
  run: dotnet clean path/to/project.sln --configuration Release && dotnet nuget locals all --clear

If you are using Powershell explicitly, use this instead:

- name: Clean
  run: |
    dotnet clean path/to/project.sln --configuration Release 
    dotnet nuget locals all --clear

There seems to be a problem (unknown as of the writing of this comment) that is fixed by this deep cleaning and only then restoring .NET tools.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Product Feedback
1 participant