- Notifications
You must be signed in to change notification settings - Fork1.1k
Description
Description
It's possible to change the path for nuget packages globally by settingNUGET_PACKAGES
environment variable (there're other means of achieving it check thedocumentation for details) .
Once that donedotnet tool
fails to start local tool. I guess it happens as tool was actually restored to nonstandard path,dotnet tool
is not able to find it there and consistently asks to rundotnet tool restore
.
Steps
- Set
NUGET_PACKAGES
environment variable to some directory other than default%userprofile%/.nuget/packages
- Initialize tool manifest by running
dotnet new tool-manifest
- Install some tool, e.g
dotnet tool install paket
- Try to run tool, e.g
dotnet paket init
Expected result
Tool is invoked (which ispaket init
in current case)
Actual result
Error message sayingRun "dotnet tool restore" to make the "paket" command available.
Running restore as suggested doesn't help. But everything works as expected after I manually move tool from the directory it was restored to to the%userprofile%/.nuget/packages
.
Haven't checked whether the same is actual for global tool installation, but would guess it is.
Environment
.NET SDK (reflecting any global.json): Version: 5.0.101 Commit: d05174dc5aRuntime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.101\Host (useful for support): Version: 5.0.1 Commit: b02e13abab.NET SDKs installed: 3.1.404 [C:\Program Files\dotnet\sdk] 5.0.101 [C:\Program Files\dotnet\sdk]