Last updated: Apr 4, 2024
Reading time·2 min
The error "'dotnet' is not recognized as an internal or external command, operable program or batch file" occurs for 2 main reasons:
'dotnet' is not recognized as an internal or external command, operable program or batch file. The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program.
To install .NET and add it to your PATH environment variable:
Make sure to close any existing command prompts and PowerShell instances for
the PATH
variable to get updated.
Open a new CMD shell and try running the dotnet
command.
dotnet --version dotnet new console -o MyApp cd MyApp
If the error persists, you have to manually add dotnet
to your PATH
environment variable.
dotnet
directory is most likely located under
C:\Program Files\dotnet
.C:\Program Files\dotnet
Add the path to dotnet
and click on "OK" twice to confirm.
Close your Command prompt application and then reopen it.
You might also have to restart your PC, but that's not always necessary.
Open a new CMD shell and try running the dotnet
command.
dotnet --version dotnet new console -o MyApp cd MyApp
To solve the error "'dotnet' is not recognized as an internal or external command, operable program or batch file", make sure: