Skip to content
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

msbuild 17.12 fails to resolve SDKs #11430

Open
BenjaminBrienen opened this issue Feb 12, 2025 · 8 comments
Open

msbuild 17.12 fails to resolve SDKs #11430

BenjaminBrienen opened this issue Feb 12, 2025 · 8 comments

Comments

@BenjaminBrienen
Copy link

BenjaminBrienen commented Feb 12, 2025

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(R) Xeon(R) Gold 6238R CPU @ 2.20GHz, 2195 Mhz, 28 Core(s), 56 Logical Processor(s)

@BenjaminBrienen
Copy link
Author

PS C:\Users\ovl-svc-PRISMAsync-b> dotnet --list-sdks
5.0.404 [C:\Program Files\dotnet\sdk]
6.0.136 [C:\Program Files\dotnet\sdk]
6.0.302 [C:\Program Files\dotnet\sdk]
6.0.428 [C:\Program Files\dotnet\sdk]
8.0.112 [C:\Program Files\dotnet\sdk]
8.0.308 [C:\Program Files\dotnet\sdk]
9.0.102 [C:\Program Files\dotnet\sdk]

@baronfel
Copy link
Member

Could you provide the list of error messages that you see? The message you linked says there should be sub-errors with more information.

@BenjaminBrienen
Copy link
Author

##[error]0>C:\cagnt03\_work\15\s\remctrl\CanonWebProxy\Module\CanonWebProxy.Module.csproj(0,0): Error : Could not resolve SDK "Microsoft.NET.Sdk". 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.
           Copying file from "C:\cagnt03\_work\15\b\Release_x64\jprep\Binaries\net8.0\win-x64\Sheela.Simulator\JobModel.ProblemModel.Impl.pdb" to "C:\cagnt03\_work\15\b\Release_x64\jprep\Binaries\net8.0\win-x64\Sheela.Tools.PrismaSyncToCje\JobModel.ProblemModel.Impl.pdb".
0>C:\cagnt03\_work\15\s\remctrl\CanonWebProxy\Module\CanonWebProxy.Module.csproj : error : Could not resolve SDK "Microsoft.NET.Sdk". 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. [C:\cagnt03\_work\15\s\BuildProcessTemplates\Templates\Build\Build.proj]
##[error]remctrl\CanonWebProxy\Module\CanonWebProxy.Module.csproj(0,0): Error : 
           Copying file from "C:\cagnt03\_work\15\b\Release_x64\jprep\Binaries\net8.0\win-x64\Sheela.Simulator\JobModel.Abstractions.pdb" to "C:\cagnt03\_work\15\b\Release_x64\jprep\Binaries\net8.0\win-x64\Sheela.Tools.PrismaSyncToCje\JobModel.Abstractions.pdb".
C:\cagnt03\_work\15\s\remctrl\CanonWebProxy\Module\CanonWebProxy.Module.csproj : error :  [C:\cagnt03\_work\15\s\BuildProcessTemplates\Templates\Build\Build.proj]
       1>Project "C:\cagnt03\_work\15\s\remctrl\remctrl.sln" (1) is building "C:\cagnt03\_work\15\s\remctrl\CanonWebProxy\Module\CanonWebProxy.Module.csproj" (3) on node 7 (default targets).
##[error]3>C:\cagnt03\_work\15\s\remctrl\CanonWebProxy\Module\CanonWebProxy.Module.csproj(0,0): Error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
3>C:\cagnt03\_work\15\s\remctrl\CanonWebProxy\Module\CanonWebProxy.Module.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found. [C:\cagnt03\_work\15\s\BuildProcessTemplates\Templates\Build\Build.proj]
       3>Done Building Project "C:\cagnt03\_work\15\s\remctrl\CanonWebProxy\Module\CanonWebProxy.Module.csproj" (default targets) -- FAILED.
       1>Project "C:\cagnt03\_work\15\s\remctrl\remctrl.sln" (1) is building "C:\cagnt03\_work\15\s\remctrl\ColoradoAPI2\ColoradoAPI2.ColoradoAPI2.csproj" (4) on node 25 (default targets).
           Copying file from "C:\cagnt03\_work\15\b\Release_x64\jprep\Binaries\net8.0\win-x64\CanonPP.Api.JobLogic\JobModel.IntentModel.Impl.pdb" to "C:\cagnt03\_work\15\b\Release_x64\jprep\Binaries\net8.0\win-x64\Sheela.Tools.PrismaSyncToCje\JobModel.IntentModel.Impl.pdb".
##[error]4>C:\cagnt03\_work\15\s\remctrl\ColoradoAPI2\ColoradoAPI2.ColoradoAPI2.csproj(0,0): Error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
4>C:\cagnt03\_work\15\s\remctrl\ColoradoAPI2\ColoradoAPI2.ColoradoAPI2.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found. [C:\cagnt03\_work\15\s\BuildProcessTemplates\Templates\Build\Build.proj]
       4>Done Building Project "C:\cagnt03\_work\15\s\remctrl\ColoradoAPI2\ColoradoAPI2.ColoradoAPI2.csproj" (default targets) -- FAILED.

@BenjaminBrienen
Copy link
Author

Image

@BenjaminBrienen
Copy link
Author

BenjaminBrienen commented Feb 12, 2025

All of the errors are the same sort of message, one for each proejct in the solution. No other error codes besides the final "build failed".

@baronfel
Copy link
Member

That's fascinating - this error is coming from the 'base' .NET SDK resolver, the one that locates the MSBuild SDKs that we ship with the .NET SDK installer. Can you see what the contents of C:\Program Files\dotnet\sdk\8.0.308\Sdks\ are on this host?

@BenjaminBrienen
Copy link
Author

PS C:\Program Files\dotnet\sdk\8.0.308\Sdks> dir


    Directory: C:\Program Files\dotnet\sdk\8.0.308\Sdks


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          2/8/2025   8:36 AM                FSharp.NET.Sdk
d-----          2/8/2025   8:36 AM                Microsoft.Build.Tasks.Git
d-----          2/8/2025   8:36 AM                Microsoft.Docker.Sdk
d-----          2/8/2025   8:36 AM                Microsoft.NET.Sdk
d-----          2/8/2025   8:36 AM                Microsoft.NET.Sdk.BlazorWebAssembly
d-----          2/8/2025   8:36 AM                Microsoft.NET.Sdk.Publish
d-----          2/8/2025   8:36 AM                Microsoft.NET.Sdk.Razor
d-----          2/8/2025   8:36 AM                Microsoft.NET.Sdk.StaticWebAssets
d-----          2/8/2025   8:36 AM                Microsoft.NET.Sdk.Web
d-----          2/8/2025   8:36 AM                Microsoft.NET.Sdk.Web.ProjectSystem
d-----          2/8/2025   8:36 AM                Microsoft.NET.Sdk.WebAssembly
d-----          2/8/2025   8:36 AM                Microsoft.NET.Sdk.WindowsDesktop
d-----          2/8/2025   8:36 AM                Microsoft.NET.Sdk.Worker
d-----          2/8/2025   8:36 AM                Microsoft.SourceLink.AzureRepos.Git
d-----          2/8/2025   8:36 AM                Microsoft.SourceLink.Bitbucket.Git
d-----          2/8/2025   8:36 AM                Microsoft.SourceLink.Common
d-----          2/8/2025   8:36 AM                Microsoft.SourceLink.GitHub
d-----          2/8/2025   8:36 AM                Microsoft.SourceLink.GitLab
d-----          2/8/2025   8:36 AM                NuGet.Build.Tasks.Pack

@BenjaminBrienen
Copy link
Author

We are going to patch C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver and see if that fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants