-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found. #2532
Comments
I fixed this by creating a path variable "MSBuildSDKsPath" with the value I don't know why msbuild can't find this path by default, but this fixed the issue for us |
Same here on Win7 |
Anyone who's still having trouble here, could you try unsetting |
@fanicia thank you!!! |
@mayconpires : Any chance you could try setting |
@DustinCampbell i just tried unchecking the variable on one of our CI servers.... and now it works without it ??? I have changed a bunch of stuff on there since i wrote the comment though, so idk :P |
I still have the issue for v *Edit: (I also get |
To clarify. I was also in the case where i was able to build with |
This suggests to me that your msbuild.exe copy does not have the following: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver |
Is everyone reporting this using "Build Tools for Visual Studio 2017" https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017 rather than full VS? |
If you have Build tools SKU:
If you have full VS:
|
@nguerrera I am using the buildtools, not the full VS. Meaning the .Net Core cross-platform development you have highligted |
... are installed? |
^yes |
You said it started working after changes to build machine. Is it possible the workload installation s one of those changes? |
i dont think so. i was having trouble adding a required nuget package to the solution... will be able to give more info when im in office next week |
@nguerrera Thanks. That was indeed our problem on server2, it was missing the .net core workload. After including it, it works fine! |
I am using VS 2017 15.4.5 and unless I SetEnvironmentVariable's I get errors in a Test Project and the documents don't load. If I set it I still get errors loading the projects but they do load. When I build with Visual Studio I get no errors.
Some of the errors
|
Hi @nguerrera I have visual studio Build tools installed. I am trying to install .NET Core workload using choco. But that is failing. Is there any official page where i can download .NET Core workload? |
@venkateswaris The official way to install the .NET Core workload is either through the Build Tools installer UI or its command line options. Documentation for the command line is here and a list of workloads for the Build Tools installer is here. In your case you probably want to ensure that the |
I'm still getting this error with all three if the fixes mentioned above. All the build tools packages are the latest and visual studio is updated to the latest version as well.
[13:47:48][Step 4/9] Executing task: BuildSource |
@bigswede74 What is PATH and what is MSBuildSdksPath? Do you have C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver ? |
@nguerrera I have added the PATH MSBuildSdksPath=C:\Program Files\dotnet\sdk\2.1.4\Sdks. I do have the SdkResolver on the file system at the location above. |
You should not need MSBuildSdksPath to be set at all. Is C:\Program Files\dotnet\ in your PATH environment variable? |
@dark2201 Can you please open a new issue, describing the conditions you're in and the exact error? Please tag me when you do. |
I ran OmniSharp with
FWIW, on my machine, dotnet in installed in |
I used my local installation
I used my local VS 2017 installation and copied resolver to build server and problem was fixed. |
Tried first MSBuildSdksPath no success Ideally an update for build tools for visual studio 2017 package should fix this |
@uciprian do you have the ".NET Core Build Tools" workload enabled for your build tools installation? |
I stumbled into this problem today, building an app that use roslyn, here there is a repro repository with a Dockerfile based upon mcr.microsoft.com/dotnet/core/sdk:3.0.100-rc1-bionic image. The program tries to analyze a simple console test source and generate warning at this line, following is the execution of the docker image that can be built and run using this script contained in the repository
UPDATE fixed by adding MSBUILD_EXE_PATH ( see here ) |
I did all kind of stuff, this is the only thing that worked form me |
This Works Like a charm . Thanks |
add environment variables MSBuildSDKsPath with value "C:\Program Files\dotnet\sdk\2.0.0\Sdks" does not work for me. copy SdkResolvers from local to build server works for me |
For me it worked by running |
If you install via choco, you need to include workloads you would normally include via the GUI: For me, I used this choco command:
|
This solved it for me, because previously I had a mixture of standard dotnet SDK installs (via Visual Studio), but also via scoop package manager. I had since removed scoop's version, but the environment variable was still pointing to the scoop directory. Just deleting the It would have been nice if the tool output this: |
Before adding the |
In my case this error was caused by a nearly empty SDK directory under |
I'm trying to build a solution using msbuild command line and I keep getting this error:
error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
The version of msbuild is the latest from microsoft visual studio 2017 tools. I'm using Windows Server 2012 R2 and the project uses .NET Core 2.0.
This is the command that I'm using:
msbuild.exe /p:Configuration=Release /t:restore C:\Projects\MyProject.sln
The text was updated successfully, but these errors were encountered: