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

Randomly failing build due to missing SDK #46910

Open
BenjaminBrienen opened this issue Feb 18, 2025 · 2 comments
Open

Randomly failing build due to missing SDK #46910

BenjaminBrienen opened this issue Feb 18, 2025 · 2 comments

Comments

@BenjaminBrienen
Copy link

Describe the bug

After updating to the newest version of Visual Studio on our build servers, build randomly fail due to failure to resolve SDKs.

This also happens with other SDKs, which are specified in global.json, such as Microsoft.NET.Sdk and Microsoft.Build.NoTargets.

To Reproduce

We are unable to reproduce this issue on developer machines and the error does not happen with every build run. It is an intermittent build flipper.

Exceptions (if any)

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.

Further technical details

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"
  }
}

NOTE: We did try updating the sdk to version 9.0.100, but the error still happens.

Windows Server 2022 (21H2)
x64
Intel(R) Xeon(R) Gold 6238R CPU @ 2.20GHz, 2195 Mhz, 28 Core(s), 56 Logical Processor(s)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Feb 18, 2025
@marcpopMSFT
Copy link
Member

Visual Studio ships with a single SDK and in the case of 17.12, that's 9.0.100 so there was no longer a .NET 8 SDK. I'm not sure why updating your global.json to 9.0.100 didn't work as that's our recommendation (using the latest SDK even when targeting downlevel). I'd have to confirm what SDK got installed and what your global.json value was. You can try installing the 8.0 SDK on the build servers or double check your 9.0.100 configuration.

You can run dotnet --info to see what SDKs are installed and you can check the host tracing to determine how it's trying to find the SDK.

@marcpopMSFT marcpopMSFT removed the untriaged Request triage from a team member label Feb 18, 2025
@marcpopMSFT marcpopMSFT added this to the Discussion milestone Feb 18, 2025
@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]

The global.json value we also tried was 9.0.100 with rollForward latestPatch

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

No branches or pull requests

2 participants