"dotnet --info" should list the SDK version of 2.1.302
Get "No SDKs were found" in CLI.
VS2017 can't find the SDK also, but the "PATH" is correct.
Windows 10 Build 17134.165
I tried on 2 machines, the issue can be reproduced.
A quick fix will be uninstall everything .NET Core related (SDK, Runtime, Hosting Bundle), and reinstall SDK only, now the "dotnet --info" can show the SDK version correctly.
However without Hosting Bundle, I can't deploy my ASP.NET Core app to local IIS in my development time, some IIS related scenarios can not be tested on Dev environment.
@EdiWang I see you are installing the x86 version. There is issue https://github.com/dotnet/core-setup/issues/4236 where depending on the version of dotnet.exe being executed the --info won't list the other side (e.g. running x64 dotnet.exe won't show x86 runtimes\sdks).
Can you verify that the C:\Program Files (x86)
folder contains the specified runtime folders that you expect? If so, then this is a duplicate of https://github.com/dotnet/core-setup/issues/4236
@steveharter I was intended to install x64 runtime and SDK only. But after I install the "Hosting Bundle", it installed both x86 and x64 runtimes on to my machine.
It is said to be included in the SDK, but after I installed SDK, there's no AspNetCoreModule in IIS, this is why I will install Hosting Bundle every time with a new .NET Core release.
As my second screenshot shows, I have both C:\Program Files (x86)\dotnet and C:\Program Files\dotnet folders in my PATH. The SDK disappears from the "dotnet --info" command. It didn't happen in previous version like 2.1.1.
The major impact is that not only does the SDK disappear from .NET Core CLI, it also disappears from Visual Studio 2017, so I can't build projects targeting .NET Core 2.1.
The only fix now is NOT to install "Hosting Bundle" after install SDK v 2.1.302. But this is blocking me from testing my application with IIS.
Here comes the ultimate fix:
I will close the issue now, and leave this to anyone who may encounter this problem in the future for reference.
I ran the repro steps and did not get the "No SDKs were found" as you did.
However, I think the default dotnet.exe
that you were running must have been the x86 version (first in %PATH% probing order) because I can get "No SDKs were found" when I manually run the x86 dotnet because of dotnet/runtime#3206.
Here's my output with x86:
C:\>"C:\Program Files (x86)\dotnet\dotnet.exe" --info
Host (useful for support):
Version: 2.1.2
Commit: 811c3ce6c0
.NET Core SDKs installed:
No SDKs were found.
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
and my output from x64 dotnet.exe (which did find the SDK):
C:\>"C:\Program Files\dotnet\dotnet.exe" --info
.NET Core SDK (reflecting any global.json):
Version: 2.1.302
Commit: 9048955601
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.302\
Host (useful for support):
Version: 2.1.2
Commit: 811c3ce6c0
.NET Core SDKs installed:
2.1.302 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
@EdiWang
Thanks, but I needed to do one more thing:
I installed the x86 version also of the SDK.
All works, no previous version garbage
@steveharter
Thanks, got fixed by deleting the x86 dotnet extry from the path.
Details,
I had the following entries in global(system variables) as well as in local (User variables) path.
_"C:\Program Files (x86)\dotnet",
"C:\Program Files\dotnet"_
Since most of the runtime and SDK which I installed was x64, gently removed "C:\Program Files (x86)\dotnet" from both global and local path.
The fix for me was simply uninstall "Microsoft .NET Core Runtime - 2.1.2 (x86)" ONLY
@steveharter maybe some problem points can be found from the system environment variables.
I found that Path contains C:\Program Files(x86)\dotnet\
and C:\Program Files\dotnet\
. And C:\Program Files(x86)\dotnet\
is in front of C:\Program Files\dotnet\
.
So the dot net command is always executed inside C:\Program Files(x86)\dotnet\dotnet.exe
.
So just delete C:\Program Files(x86)\dotnet\
.
I just deleted SDK, Runtime x86, and then install SDK x64
I think the problem is when you install Microsoft .NET Core Runtime you get x64 and x86,
but you have only SDK x64 or x86 . And it try to find compatible version to Runtime and
after failure it delete your SDK.
@steveharter maybe some problem points can be found from the system environment variables.
I found that Path containsC:\Program Files(x86)\dotnet\
andC:\Program Files\dotnet\
. AndC:\Program Files(x86)\dotnet\
is in front ofC:\Program Files\dotnet\
.
So the dot net command is always executed insideC:\Program Files(x86)\dotnet\dotnet.exe
.
So just deleteC:\Program Files(x86)\dotnet\
.
Yep. It works for me. Just delete C:\Program Files(x86)\dotnet\
. Thanks.
EdiWang's the ultimate fix: works for me.... Thanks a lots. ;D
I had success with using _'Add or remove programs'_ and Uninstalling all dotnet references to (x86) 32-bit...after it switched back to 64 bit and worked fine
@steveharter
Thanks, got fixed by deleting the x86 dotnet extry from the path.
Details,
I had the following entries in global(system variables) as well as in local (User variables) path.
_"C:\Program Files (x86)\dotnet", "C:\Program Files\dotnet"_Since most of the runtime and SDK which I installed was x64, gently removed "C:\Program Files (x86)\dotnet" from both global and local path.
Thanks, it was helpful. Solved my problem.
I had success with using _'Add or remove programs'_ and Uninstalling all dotnet references to (x86) 32-bit...after it switched back to 64 bit and worked fine
I know I'm late, but this. I just removed the .net 32bit runtime and everything was immediately fixed.
Just here to plug something that would've helped me and others find this thread several hours sooner.
vscode C# extension
'Error: Failed to find up to date dotnet cli on the path.'
The only thing that solved for me was the following:
Most helpful comment
Here comes the ultimate fix:
I will close the issue now, and leave this to anyone who may encounter this problem in the future for reference.