1

I have a fresh install of windows 11.

I installed .net from here: https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.300-windows-x64-installer

It went through the installer, and I accepted all the defaults.

The SDK says it includes the runtime.

I should now be able to open a new cmd window and type "dotnet".

When I do I get:

'dotnet' is not recognized as an internal or external command,
 operable program or batch file.

I tried running the installer again, and doing repair, but this did not help. Nor did reboot.

How do you install .net?

If I look at my path, it contains: ";C:\Users\me\.dotnet\tools"

But if I look in the tools dir, I only see:

06/03/2022  12:47 PM    <DIR>          .
06/03/2022  12:47 PM    <DIR>          ..
06/03/2022  12:47 PM                 5 6.0.300_IsDockerContainer.dotnetUserLevelCache
06/03/2022  12:47 PM                64 6.0.300_MachineId.dotnetUserLevelCache
06/03/2022  12:47 PM                64 MachineId.v1.dotnetUserLevelCache
06/03/2022  12:47 PM    <DIR>          TelemetryStorageService
               3 File(s)            133 bytes

Any ideas?

Do I also need to install .net core?

==== Update 1 ====

Well, I found a partial solution.

Installing the x64 bit installs without error, but dotnet is not runnable after.

I just tried installing the ARM64 version, and after install, now I can run the dotnet command.

However, when I try to run

dotnet tool install --global ServiceBusAdmin

It says:

C:\Program Files\dotnet>dotnet tool install --global ServiceBusAdmin
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:
  * You intended to execute a .NET program:
      The application 'tool' does not exist.
  * You intended to execute a .NET SDK command:
      It was not possible to find any installed .NET SDKs.
      Install a .NET SDK from:
        https://aka.ms/dotnet-download

I guess there is no way to run .net console apps on windows 11 running in parallels on mac.

John Little
  • 10,707
  • 19
  • 86
  • 158
  • Does this answer your question? [Visual Studio Code error - 'dotnet' is not recognized as an internal or external command](https://stackoverflow.com/questions/53852594/visual-studio-code-error-dotnet-is-not-recognized-as-an-internal-or-external) – Mykyta Halchenko Jun 03 '22 at 11:01
  • Yes, I have read that thread. Some say .net core is required, but it isnt (according to MS), some say you need to manually edit the path, but the exe is missing so this wont help, and some say repair works, but this didnt. A final one says to "kill terminal" but I dont seem to have this option. – John Little Jun 03 '22 at 11:06
  • "but the exe is missing" - you haven't said whether there's anything in `C:\Program Files\dotnet`, which is where I'd *expect* to find the executable... – Jon Skeet Jun 03 '22 at 11:15
  • Interestingly, the exe was there. however after installing the arm version, it seems to work, partually. – John Little Jun 03 '22 at 11:26
  • See https://stackoverflow.com/questions/67049414/windows-or-visual-studio-cant-find-the-latest-installed-net-sdk-due-to-bitness – RickAndMSFT Jun 04 '22 at 18:14

1 Answers1

0

I also had the same error when i run dotnet in cmd. It turned out that this error occurred because I changed the system variables.

So check your System Variables: Go to Enviromental Variables. Then to System Variables. Make sure you see under 'variable', Path. Then make sure it has the path of the dotnet added as seen in the image My value of the path was: C:\Program Files\dotnet. If not, then add it. This solved my problem. And dotnet was able to run afterwards on cmd.system variable snapshot

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 24 '23 at 16:02