Home > Blockchain >  dotnet commands in cmd freezing. What's wrong?
dotnet commands in cmd freezing. What's wrong?

Time:12-17

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.

CodePudding user response:

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.
  • Related