3

With a great amount of frustration I have been trying to solve the following error in Visual Studio Code:

The term 'dotnet' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct and
try again. 
At line:1 char:7 + dotnet <<<<  --info
    + CategoryInfo          : ObjectNotFound: (dotnet:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I have researched far and wide to no avail. I have tried a number of other peoples' solutions and still, the error persists. I have installed, repaired and uninstalled the necessary installation files a number of times... still the error persists!

I am running Win7 Pro with all the updates. VS Code 1.28.2. NET Core SDK 2.1.403.

I look forward to any suggestions/pointers/insights.

Arslanbekov Denis
  • 1,674
  • 12
  • 26
MARz
  • 33
  • 1
  • 1
  • 4
  • Apparently you're running a powershell script. Can you post it alongside your question? – amdmax Nov 06 '18 at 12:37
  • Thanks for the reply. Currently, I'm not running a PowerShell script, just entering _dotnet --info_ at the command prompt... – MARz Nov 06 '18 at 22:10
  • Also you can look at https://stackoverflow.com/questions/40568758/dotnet-is-not-recognized-as-the-name-of-a-cmdlet – sashoalm Jan 09 '21 at 19:17

2 Answers2

2

Is dotnet binary properly set in your PATH environment variable? For windows: https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/

Niels
  • 620
  • 4
  • 13
  • Thanks for the input. I believe I have the right PATH info. Here it is: _;C:\Users\Matt\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Matt\.dotnet\tools_ – MARz Nov 06 '18 at 22:05
  • I don't have a windows right now but pretty sure the dotnet cli is somewhere like: C:\Program Files\dotnet\sdk\x.x.x\, confirm the path on your machine then add it to your PATH env variable, restart VS code and should be ok – Niels Nov 08 '18 at 06:03
1

The same thing happened to me, and all I needed to do was install the .NET Core SDK for vs code (from Microsoft) here's the link:

https://dotnet.microsoft.com/download/dotnet-core/sdk-for-vs-code

desertnaut
  • 57,590
  • 26
  • 140
  • 166
James
  • 11
  • 1