msbuild: msbuild 17.12 fails to resolve SDKs
Issue Description
After updating to the newest version of Visual Studio on our build servers, build randomly fail due to failure to resolve SDKs.
Error : Could not resolve SDK "Microsoft.NET.Sdk.Web". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.
This also happens with other SDKs, which are specified in global.json, such as Microsoft.NET.Sdk and Microsoft.Build.NoTargets.
Steps to Reproduce
I can’t provide any samples or logs
Expected Behavior
Builds the same as in 17.10
Actual Behavior
Fails to resolve SDKs
Analysis
The problem started happening immediately after VS 17.12.4 was installed. We did not see this problem in version 17.10.3.
Versions & Configurations
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.12.4
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
C:\Program Files\Microsoft Visual Studio\2022\professional>msbuild --version
MSBuild version 17.12.12+1cce77968 for .NET Framework
17.12.12.57101
{
"msbuild-sdks": {
...
"Microsoft.Build.NoTargets": "3.7.56",
...
"MSTest.Sdk": "3.7.3"
},
"sdk": {
"version": "8.0.302",
"rollForward": "latestPatch"
}
}
Windows Server 2022 (21H2) x64 Intel® Xeon® Gold 6238R CPU @ 2.20GHz, 2195 Mhz, 28 Core(s), 56 Logical Processor(s)
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 44 (42 by maintainers)
So the first step is done: the backport was merged. Now there are some additional steps to let this propagate through the system. I will post updates as they happen.
So, it isn’t just us!
Hi, I’m running into a similar issue and I think it’s caused by this bug as well:
The SDK resolver assembly "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\Microsoft.DotNet.MSBuildSdkResolver.dll" could not be loaded. Could not load file or assembly 'Microsoft.DotNet.MSBuildSdkResolver, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.https://github.com/dotnet/msbuild/blob/1cce77968bca1366760f361c837ffbc3a6af70f0/src/Build/BackEnd/Components/SdkResolution/SdkResolverService.cs in that version does not yet include the fix https://github.com/dotnet/msbuild/pull/11079. v17.14.0-preview-25110-01 includes that fix.
@SimaTian can you investigate please and see if that PR could have had this kind of side effect?