-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET6 - MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found #23311
Comments
I'm having the same error, |
Does this happen when you run |
Same issue for myself msbuild Version
dotnet build
Build Tools> Get-VSSetupInstance
InstanceId : 8c96e9e2
DisplayName : Visual Studio Build Tools 2022
InstallationVersion : 17.2.32516.85
InstallationPath : C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
InstallDate : 5/17/2022 10:22:51 AM
Dotnet --infok>dotnet --info
Host (useful for support):
Version: 6.0.5
Commit: 70ae3df4a6
.NET SDKs installed:
5.0.408 [C:\Program Files\dotnet\sdk]
6.0.105 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
|
Also having this issue in Azure CI |
I think I've found the cause of this problem. My system environment variables contain an entry for In Deleting that PS: I found out about this because when I did a
Which explained what was happening much better, and pointed so much closer to the real issue in contrast to "SDK not found". "Not found" is like the second hardest problem to solve than "A problem occurred". Please fix this, if not the issue, the message. |
Adding my experience: I wasn't getting the MSB4236 error. Instead I was getting
This worked for me too. Mine actually had this value in it before I deleted it: I also confirmed that updating the Now I wonder why I even had it in the first place. I wonder if it was something related to vscode... |
I dont see MSBuildSDKsPath in my environment variables. Is this issue gonna be fixed?? |
Add the environment variable |
This solution fixed my issues with VS 2019 and 2022. After I installed the latest versions of both IDEs they went MIA. 2019 could not load projects, and 2022 could not run them!!! First installed the latest NET 6 SDK which did not resolve the issue. Then applied this solution and voila!!! Thanks Drew. |
It works for me. |
Thank. When I run command "dotnet build" it show error. I have to download Net 7 (x86 and x64) and worked |
Thanks guys, you put me on the right path: I had no environment variable for the sdk path and adding it only led to a more specific error (sub sdk missing). I had to change the Path environment variable (I'm on win 10): move the "C:\Program Files\dotnet" entry on top of "C:\Program Files(x86)\dotnet" solved the problem. For me it happened after a Visual Studio update. I did update build tools as well. |
For me the issue was with I was still using Updating to Additional tip: While I'm still running the tests in a NetFx 4.8 test host, I for some reason had to use |
.NET6 - MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found
Describe the bug
After installing .NET6 on Windows Server 2016 every project that I try to build on that machine fails due to
MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found
To Reproduce
Install latest SDK (.NET6) and Runtime on Windows Server 2016. Doesn't matter if I use .NET installer or binaries or even Visual Studio Build Tools 2022
Exceptions (if any)
On my local dev machine - Windows 10, everything works fine
Further technical details
This machine used to have all the previous .NET Core SDKs and Runtimes. I have uninstalled all of them so my machine is clean. I have also checked Environment Variables and they also look normal.
Windows Server 2016
dotnet --info
The text was updated successfully, but these errors were encountered: