'Dotnet tool restore' does not work correctly when NUGET_PACKAGES (global-packages) is set to an alternative location
See original GitHub issueIssue Title
‘dotnet tool restore’ does not work correctly when NUGET_PACKAGES (global-packages) is set to an alternative location.
Description
If you set NUGET_PACKAGES to an alternate folder. “D:\cache” on a build agent for instance,
dotnet tool restore # and then directly after
dotnet paket info # or paket <whatever>.
will fail with $lastexitcode=1 and
Run "dotnet tool restore" to make the "paket" command available.
The same error happens for at least two other tools as well. gitversion.tool and dotnet-fsharplint.
Repro steps
See this minimal example: https://github.com/da9l/dotnetpaketProblem_minimalExample/blob/master/readme.md
Expected behavior
it should work.
Actual behavior
fail with $lastexitcode=1 and
Run "dotnet tool restore" to make the "paket" command available.
Known workarounds
Don’t set NUGET_PACKAGES
to anything non-standard.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:19
- Comments:14
Top Results From Across the Web
dotnet restore command - .NET CLI
To restore the dependencies, NuGet needs the feeds where the packages are located. Feeds are usually provided via the nuget.config configuration ...
Read more >Tool not found after `dotnet tool restore` even ... - YouTrack
Tool not found after `dotnet tool restore` even though `dotnet tool list --local` shows the tool as present. This issue has only become...
Read more >Is it possible to change the location of packages for NuGet?
I could not get the latest nuget (2.8.5) to find a packages folder outside of the standard location without enabling package restore.
Read more >Dotnet restore vs nuget restore. Share. In my code repo, there
I am trying to restore NuGet packages in my project using the CLI. ... It is a common problem with the use of...
Read more >.NET Core 3 Local Tools
The tool is installed to the global nuget package cache, like a typical nuget package, if the user does not have the package...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just want to share my findings; that I managed to work around it by deleting the %USERPROFILE%.dotnet\toolResolverCache folder before running dotnet tool restore.
deleting
toolResolverCache
seems to fix the issue. On linux it’s at~/.dotnet/toolResolverCache