Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 492
DisplayName001 Avatar asked Dec 19 '18 13:12

DisplayName001


People also ask

Where is the dotnet command?

In System variables, select path and edit. After semicolon, write "C:\Program Files\dotnet"


2 Answers

you need to download and install .NET Core SDK

https://dotnet.microsoft.com/download

like image 175
Derviş Kayımbaşıoğlu Avatar answered Oct 15 '22 15:10

Derviş Kayımbaşıoğlu


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.

like image 42
Jesper Riemer Andersen Avatar answered Oct 15 '22 13:10

Jesper Riemer Andersen