2

I'm following a course that instructed me to install SDK 7.0.101 from https://dotnet.microsoft.com/en-us/download/dotnet/7.0 (x64)

Once installed, in command line I'm supposed to be able to use dotnet commands. "dotnet --info" works and shows my current sdk info. However. as soon as I use "dotnet -h" to bring up a list of commands in order to create an API project, it just hangs and does nothing.

.NET SDK:
 Version:   7.0.101
 Commit:    bb24aafa11

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.101\

Host:
  Version:      7.0.1
  Architecture: x64
  Commit:       97203d38ba

.NET SDKs installed:
  7.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

In the command prompt, I entered dotnet -h. I was expecting a list of commands to display. Nothing populates and I have to wait several minutes before I can shut down the command prompt.

RobTech341
  • 23
  • 3

1 Answers1

1

Here are 2 possible problems on the dotnet side and on the cmd side.

Let's start with check that dotnet is works fine:

  1. Check that dotnet.exe exists at path C:\Program Files\dotnet\
  2. Check that variable path C:\Program Files\dotnet\dotnet.exe added to the PATH.

CMD side:

  1. Relaunch of cmd prompt can be solution btw (bcs after relaunch shell will track updated PATH variable).
  2. If that's not a solution, this can be the problem of command prompt that solved and explained there.
  • So if I understand this solution right, my Base Path: C:\Program Files\dotnet\sdk\7.0.101\ should be Base Path: C:\Program Files\dotnet? And if so, why would the installation create the wrong path? – RobTech341 Dec 14 '22 at 19:51
  • 1
    Check that dotnet.exe exists at path C:\Program Files\dotnet\ and variable path C:\Program Files\dotnet\dotnet.exe added to the PATH – Valeriy Vartumyan Dec 14 '22 at 20:16
  • If that all just doesn't works, try to simply reinstall :3 – Valeriy Vartumyan Dec 14 '22 at 20:49
  • 1
    And check this issue because that can be problem of cmd https://stackoverflow.com/questions/33883530/why-is-my-command-prompt-freezing-on-windows-10 – Valeriy Vartumyan Dec 14 '22 at 20:57
  • 1
    Thank you, the issue is fixed! I turned off quickedit mode from cmd and also added C:\Program Files\dotnet\dotnet.exe to the variable paths. Not positive which resolved it but it's working now. – RobTech341 Dec 14 '22 at 21:25
  • Mark that post is solution for others researches pls – Valeriy Vartumyan Dec 15 '22 at 09:32