dotnet is not recognized as the name of a cmdlet
Solution 1
After again coming across this problem, we found the answer here.
Open Programs and Features, choose Microsoft Visual C++ Redistributable (x86), click Uninstall and then choose Repair. After repairing it (and the x64 version if you have it), reinstall or repair the installation of the .NET Core SDK 1.0.1.
Solution 2
Also ensure that "C:\Program Files\dotnet"
is part of the "path" system environment variable.
After uninstalling previous SDK versions, it had disappeared from mine.
Solution 3
This error also occurs if .Net Core is not installed on your machine. To verify it, please run the command dotnet --help
from Windows PowerShell or VS Code terminal. If .Net Core is installed then you will see the output, else the same error. If you see the same error then:
- Please download and install it from here.
- Then close the CLI or Code editor you are using.
-
Re-open it again, run the following command:
dotnet new webApp -o aspnetcoreapp
It will hopefully let you get rid of the problem.
Solution 4
I had a same problem. It can be fixed by following this solution:
-
Open command window (win+R) then:
cd Desktop mkdir CSharp cd CSharp
-
Open new file on desktop, then after that
dotnet new console -o firstapp cd firstapp code
vs code automatically opened.
-
Then you open the terminal:
dotnet restore dotnet run
Finally done.
You can watch this video.
Shaun Luttin
My professional work focuses on designing, testing, implementing/securing, and deploying distributed services. I kind be "that guy" too. Ship it!
Updated on January 10, 2021Comments
-
Shaun Luttin over 3 years
We have downloaded and run
DotNetCore.1.0.1-SDK.1.0.0.Preview2-003133-x64.exe
. After having closed and reopened our command prompt, runningdotnet
gives the following output.The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program.
We have tried the following:
- Uninstall all versions of Visual Studio.
- Uninstall all versions of .NET Core.
- Repair C++ Redistributable 2015 x86 & x64
- Restart the computer.
- Then reinstall the .NET Core SDK.
This is the contents of
C:/Program Files/dotnet
host fxr sdk 1.0.0-preview2-003133 shared Microsoft.NETCore.App swidtag Microsoft .NET Core 1.0.1 - SDK 1.0.0 Preview 2-003133 (x64).swidtag
Our PATH includes
C:\Program Files\dotnet\