I've successfully installed the latest .NET SDK, but Windows doesn't recognize it. This is manifested by one of the following failures:
dotnet --list-sdks
doesn't include the latest .NET SDK.Project 'MyProject' load failed: The specified SDK "Microsoft.NET.Sdk" was not found.
Unable to locate the .NET SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version
The current .NET SDK does not support targeting .NET Core N.N. Either target .NET Core N.M or lower, or use a version of the .NET SDK that supports .NET Core N.N
How can I get Windows to recognize the latest installed version of the .NET SDK?
NET 6 SDK, it's installed to the C:\Program Files\dotnet\x64\ folder.
You can see both the SDK versions and runtime versions with the command dotnet --info . You'll also get other environmental related information, such as the operating system version and runtime identifier (RID).
NET Core can be installed in two ways: By installing Visual Studio 2017/2019 or by installing . NET Core Runtime or SDK. . NET Core installer already contains ASP.NET Core libraries, so there is no separate installer for ASP.NET Core.
Run where dotnet
from the command line. If the output is similar to:
C:\Program Files (x86)\dotnet\dotnet.exe
C:\Program Files\dotnet\dotnet.exe
Then both the 32-bit and 64-bit versions of the SDK have been installed at some time.
32 bit --- C:\Program Files (x86)\dotnet\dotnet.exe
64 bit --- C:\Program Files\dotnet\dotnet.exe
The first SDK installed on the computer puts the dotnet path in the system path. Any subsequent SDK install of a different bit size SDK also adds dotnet path to the system path, but after the first dotnet path. Therefore, only SDK's of the first bit size are available by default, using the path
variable.
There are two approaches to fixing the problem:
C:\Program Files (x86)\dotnet\dotnet.exe
and C:\Program Files\dotnet\dotnet.exe
in the System environment variables path:Select the windows key and enter Edit
, then select Edit the system variables
Select the Environment Variables button on the Advanced tab:
Select the Path > Edit under System variables (not User variables).
Find the entries for C:\Program Files\dotnet\dotnet.exe
(64 bit) and C:\Program Files\dotnet\dotnet.exe
(32 bit) and using the Move up button, change to order. Here's an example:
Select the OK button until all the windows are closed. Open a new command prompt and run where dotnet.
Answer from https://github.com/dotnet/core/issues/5962 More details at https://weblog.west-wind.com/posts/2019/Apr/20/Adventures-in-NET-SDK-Installation-SDKs-not-Showing-Up
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With