-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Dotnet tool restore' does not work correctly when NUGET_PACKAGES (global-packages) is set to an alternative location #11432
Comments
We ran into this issue as well. As a workaround, we had to create a symbolic link from the standard location to our customized location so that the dotnet cli would behave properly.
|
hi,
win 10 x64 nuget <config>
<add key="repositoryPath" value="./../pckgs" />
</config>
how to reproduce |
Still happens with latest SDK. It makes local tooling unusable for teams as restore cannot be used and developers are forced to reinstall the tools by hand which is something that could be avoided by local tooling manifest usage. Any reliable workaround for using custom packages path with local tools? |
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. |
We have the same issue. |
deleting |
The most robust workaround I have found. Assuming Windows, NuGet packages at c:\NuGet, powershell: |
You saved my day, thank you! |
This workaround does seem to be sufficient for now. Are there plans to fix this issue, however? |
Same problem for us. We run tests in parallel and those tests do project restores which often have the same set of files that need to be downloaded from a nuget feed. We put in the override in the nuget.config to make each test use a separate packages cache to avoid the concurrency problem. Because of this issue: NuGet/Home#8129 But now that we're trying to incorporate use of tools, the restore fails on some machines. Deleting the 'toolResolverCache' folder for the user helps, but that's terrible in a concurrent test environment where multiple tests need the tool. And we also do not want to install stuff globally. |
Seems like we need a way in the nuget.config file (and/or environment varaible) to specify the toolResolverCache location so we can point to a local folder in the same way we can point to a local packages cache. |
Like you say, it's pretty rough in a concurrent test environment. It's causing some headaches. |
Redirecting |
This might have renewed relevance given the release in Windows' Dev channel preview of Dev Drive, where an explicitly called-out use case is to redirect package caches there. I recently hit this myself and got around it with the workaround, but when this hits GA more developers may encounter this. |
Likewise, I just switched to dev drive and found that dotnet tool restore doesn't work with it... |
This is on our list to tackle - it's one of the things that we have more control over now that we're not doing an behind-the-scenes |
Quite a challenge to tackle it since its 3 years already... |
Stumbled upon this after setting up my DevDrive. What is the status on this? Looks like no progress for the past 6 months. |
@klemmchr I think everyone's just using the symlink workaround still |
This is a better workaround in my opiniopn #11432 (comment) |
That is only a temporary workaround and will not completely resolve the issue. |
Issue 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,
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.The text was updated successfully, but these errors were encountered: