24

We have downloaded and run DotNetCore.1.0.1-SDK.1.0.0.Preview2-003133-x64.exe. After having closed and reopened our command prompt, running dotnet gives the following output.

The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program.

We have tried the following:

  1. Uninstall all versions of Visual Studio.
  2. Uninstall all versions of .NET Core.
  3. Repair C++ Redistributable 2015 x86 & x64
  4. Restart the computer.
  5. Then reinstall the .NET Core SDK.

This is the contents of C:/Program Files/dotnet

host
  fxr
sdk
  1.0.0-preview2-003133
shared
  Microsoft.NETCore.App
swidtag
  Microsoft .NET Core 1.0.1 - SDK 1.0.0 Preview 2-003133 (x64).swidtag

Our PATH includes C:\Program Files\dotnet\

Shaun Luttin
  • 107,550
  • 65
  • 332
  • 414
  • Did you solve this. I am going through it now but on "1.0.1-preview3-004056" in VS2015. – K7Buoy Feb 15 '17 at 14:38
  • @K7Buoy I did solve it, but I'm afraid I did not document the solution. – Shaun Luttin Feb 15 '17 at 15:57
  • I had to roll back in my project.json to 1.0.0-preview2-003131. Something messed my system up, I have been messing about with Gulp and Bash over the last couple of days and my PATH had been removed as well. All sorts going on for some reason. – K7Buoy Feb 15 '17 at 16:35
  • @K7Buoy I have since found a answer that works for us. – Shaun Luttin Mar 15 '17 at 03:18

7 Answers7

18

Also ensure that "C:\Program Files\dotnet" is part of the "path" system environment variable.

After uninstalling previous SDK versions, it had disappeared from mine.

Papa Stahl
  • 449
  • 5
  • 7
14

This error also occurs if .Net Core is not installed on your machine. To verify it, please run the command dotnet --help from Windows PowerShell or VS Code terminal. If .Net Core is installed then you will see the output, else the same error. If you see the same error then:

  • Please download and install it from here.
  • Then close the CLI or Code editor you are using.
  • Re-open it again, run the following command:

    dotnet new webApp -o aspnetcoreapp
    

It will hopefully let you get rid of the problem.

Rohit416
  • 3,114
  • 3
  • 21
  • 38
Jitender Kumar
  • 1,867
  • 2
  • 22
  • 40
6

After again coming across this problem, we found the answer here.

Open Programs and Features, choose Microsoft Visual C++ Redistributable (x86), click Uninstall and then choose Repair. After repairing it (and the x64 version if you have it), reinstall or repair the installation of the .NET Core SDK 1.0.1.

Shaun Luttin
  • 107,550
  • 65
  • 332
  • 414
0

In my case the issue had to do with the x64 vs. x86 discrepancy.
My path had x86 in it. I manually changed it to "Program Files" rather than "Program Files (x86) and it started working again.

zx485
  • 24,099
  • 26
  • 45
  • 52
0

Go to Apps and Features, Search for Microsoft Visual C++ Redistributable 2015 Click the modify button and then click repair, do this for both versions of Microsoft Visual C++ Redistributable 2015. It should then prompt you to restart device. This worked for me!!

mark
  • 31
  • 4
0

Go to the Control Panel->Microsoft Visual C++ Redistributable(x86)-> Repair. Following this completion, Microsoft .NET core SDK-> Repair. It will work.

0

I had a same problem. It can be fixed by following this solution:

  1. Open command window (win+R) then:

    cd Desktop
    mkdir CSharp
    cd CSharp
    
  2. Open new file on desktop, then after that

    dotnet new console -o firstapp
    cd firstapp
    code 
    

    vs code automatically opened.

  3. Then you open the terminal:

    dotnet restore
    dotnet run
    

Finally done.

You can watch this video.

RobC
  • 16,905
  • 14
  • 51
  • 62