Visual Studio Code error - 'dotnet' is not recognized as an internal or external command

Viewed 51315

Setup:
Windows 7 64 bit
Visual Studio Code, version 1.30.0
Dotnet version: 2.2.101

I am at the beginning of trying to learn how to program with C# and I have hit a snag.

I am attempting to follow the tutorial https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code and I am not getting past the start of it.

The only wrinkle I can think of is that I have installed Visual Studio on my D: drive. I have checked my environmental variables and I see that if I go into my system variables under the path variables I see C:\program files\dotnet.

Also if I am in the interactive terminal in Visual Studio I can go to the folder location of the dotnet.exe, type in the terminal >dotnet --version and a dotnet version shows on my terminal.

Do I need to muck with my environment variables or move my dotnet.exe file to the D drive also to get this puppy goin?

5 Answers

As the other answers mention, I needed to first install .NET. But after install and restart, the problem persisted for me.

The final fix for me was to click the "Kill Terminal" button and then open a new one. Apparently the terminal session can survive a restart.

it could be because, maybe you haven't installed the dotnet core yet, which seems to be required prior to installing the asp.net core spa template. To check if you have installed the .net core in your machine or not, check if this exists

C:\Program Files\dotnet\sdk

or just type following in command prompt

dotnet --version

or You need to install .NET SDK separately. You can download and install it from here

I hit install from the installation directory by double-clicking the download and by selecting Repair. (There were two other options Uninstall and Cancel).

After repair, I just typed dotnet --version at the cmd prompt and got the version displayed.

My environment is Windows 10 on AMD64 processor.

I have faced the same issue, Problem statement:- I have installed dotnet core sdk in my sys, even than when I hit dotnet in command prompt I was getting ,

dotnet-is-not-recognized-as-an-internal-or-external

Solution :- I have added dotnet path to advanced system settings-> Environment variables-> user variables. Path = "C:\Program Files\dotnet" refer the image error solved

Related