I am trying to install a global tool. However, I always get the same error message regardless of the tool I try to install (e.g. also for dotnetsay
):
C:\Users\Christer\Source\Repos\faketest>dotnet tool install fake-cli -g
Failed to install tool package 'fake-cli': Could not find a part of the path 'C:\Users\Christer\.dotnet\tools\.store\.stage\0qd2mqpa.m45\fake-cli'.
Tool 'fake-cli' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
I have tried for several hours to clean up my environment, PATH, reinstall VS, etc., but I can't figure out why this doesn't work.
I get the same problem when specifying a tool path.
I'm sorry for what is evidently a support request, but I haven't found anything on google, SO, etc. I'm one step short of reinstalling my whole system and have nowhere else to turn.
What could be wrong? Why doesn't this work? What could I do to troubleshoot further?
dotnet info:
C:\Users\Christer\Source\Repos\faketest>dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.1.700
Commit: c2ef055a0f
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.700\
Host (useful for support):
Version: 2.2.5
Commit: 0a3c9209c0
.NET Core SDKs installed:
2.1.700 [C:\Program Files\dotnet\sdk]
2.2.300 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Nevermind, I found the issue. I removed the MSBuildSDKsPath
environment variable and now everything works fine.
I am running into the same issue and thanks to @cmeeren for clueing me in, I had to delete the environment variable RestorePackagesPath that I intentionally set to a specific location. Although I can now install dotnet tooling again, this leaves me wondering why it does not respect the value of RestorePackagesPath.
What solved the issue for me was running the command from the windows command line instead of the one embedded in VS. I wish I could tell you why ;(
@jtbrower Thanks a lot
go to your Environment Variables
on your user variables , make sure MSBuildSDKsPath
points to where your latest dotnet sdks are
C:\Program Files\dotnet\sdk\3.1.201\Sdks
go to your Environment Variables
on your user variables , make sure MSBuildSDKsPath
points to where your latest dotnet sdks are
C:\Program Files\dotnet\sdk\3.1.201\Sdks
@OscarAgreda Thank you for that information. It made it possible for me to install the dotnet-ef tool. 馃憤
go to your Environment Variables
on your user variables , make sure MSBuildSDKsPath
points to where your latest dotnet sdks are
C:\Program Files\dotnet\sdk\3.1.201\Sdks
@OscarAgreda Are any other environmental variables needed? I don't have any environmental variables that I probably should. Especially MSBuildSDKsPath.
Most helpful comment
Nevermind, I found the issue. I removed the
MSBuildSDKsPath
environment variable and now everything works fine.