Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Did you mean to run dotnet SDK commands? Please install dotnetsdk" in windows command prompt

I have just installed dot net core sdk and runtime (2.2.1) on my system viz. a Windows Server 2012R2. I am trying to create a console app using the command prompt using

dotnet new console

but it says

Did you mean to run dotnet SDK commands? Please install dotnetsdk

Is there any other configurations needed. The Environment path variable also contains the following folder C:\Program Files\dotnet. I have not installed VS2017. Was trying to use VS Code

like image 426
user9057272 Avatar asked Feb 05 '19 20:02

user9057272


2 Answers

In my case somehow I also had a C:\Program Files (x86)\dotnet with a runtime version there which was picked from Path instead of the SDK in C:\Program Files\dotnet

This was causing exactly the same error message + it was breaking solutions in Visual Studio (but not in Rider)

like image 132
tomasz_kajetan_stanczak Avatar answered Oct 22 '22 15:10

tomasz_kajetan_stanczak


Please, make sure you've installed SDK not just runtime.

enter image description here

UPDATE

This is what you will see on the server without SDK installed if you run dotnet.exe --list-sdks command

enter image description here

And this with SDK installed:

enter image description here

One needs to install SDK on a development machine to be able to build and run applications and runtime (usually on an application server or user machine) to be able to just run built applications.

like image 5
BigMuzzy Avatar answered Oct 22 '22 17:10

BigMuzzy