Home > Software design >  "dotnet" command does nothing
"dotnet" command does nothing

Time:03-28

I'm trying to install a global package through dotnet cli but the command dotnet does nothing. I don't get an error message that says the command is not found etc. but it also doesn't run.

enter image description here

Between each line, cursor inside the powershell (or command prompt) turns into Working In Background ( ) mode but after just a few seconds, it just gets into the new line without doing anything. During these few seconds, if I move the cursor outside the prompt, it goes back to regular mode. So it's doing something I guess.

What is happening here, and how can I solve this issue?


What have I already tried:

1-) Since my network is behind a proxy, I've added the proxy credentials through NPM configuration commands. (enter image description here

CodePudding user response:

I uninstalled all the .NET SDKs and runtimes, I also removed all the installed modules on both VS 2019 and VS 2022 Preview using the Visual Studio Installer, then restarted my computer.

While installing the SDKs and runtimes from Microsoft's website I checked the .NET version using the command line and command dotnet --version after every installation to see when exactly it starts not working. After installing all the SDK's up to .NET 5, there was no issue. And since I did not really need the .NET 6 SDK I didn't specifically download it thinking VS 2022 Preview would automatically install it anyways.

Using Visual Studio Installer, I installed the necessary components for the dotnet development on the VS 2019 and the previously mentioned command was working on point. Then I proceeded to install the necessary components on the VS 2022 Preview but after installing it, the command started to not work. So there it was, the source of the problem. Something about VS 2022 Preview's installment process just corrupts dotnet cli, but I'm not sure if it's just me.

You also need a restart after all the installments or dotnet cli might show some errors.

  • Related