You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Operational Issue]: SB_*_Offline_CurrentSourceBuiltSdk legs fail deterministically — OverlaySdkOnLKG can't find BundledVersions.props due to +<sha> build metadata in SDK version #7901
error : Could not find a part of the path
'/__w/_temp/previously-source-built-sdk/sdk/11.0.100-preview.7.26371.117+766c39a8f28bfdbfb61e7a6ed570b5e94c28c831/Microsoft.NETCoreSdk.BundledVersions.props'
at OverrideAndCreateBundledNETCoreAppPackageVersion.Execute()
in .../src/sdk/src/Tasks/sdk-tasks/OverrideAndCreateBundledNETCoreAppPackageVersion.cs:line 31
dotnet/sdk#55329 enabled the NativeAOT implementation of the dotnet CLI in source-built SDKs. This changed which code handles dotnet --version.
The NativeAOT CLI’s --version action prints Product.Version. Product.Version normally reads the SDK version from its .version file. If that file cannot be found, it falls back to the assembly informational version.
The PR did run a genuine Stage 2 build. However, it was a CI build using the simplified 11.0.100-ci versioning pattern. The fallback value still matched the physical sdk/11.0.100-ci/ directory, so the bug remained hidden.
The official build added the source-revision metadata, exposing the invalid assumption that dotnet --version can always be used directly as an SDK directory name.
This should be an easy fix - we already have a mechanism for locating 'the versioned SDK root directory' in the SdkPaths class, we just need to use it on this code path.
Activity
mthalman commentedon Jul 22, 2026
Root cause
dotnet/sdk#55329 enabled the NativeAOT implementation of the
dotnetCLI in source-built SDKs. This changed which code handlesdotnet --version.The NativeAOT CLI’s
--versionaction printsProduct.Version.Product.Versionnormally reads the SDK version from its.versionfile. If that file cannot be found, it falls back to the assembly informational version.Under NativeAOT,
AppContext.BaseDirectoryis the .NET installation root, rather than the selected versioned SDK directory. Consequently, the.versionlookup fails andProduct.Versionuses the fallback.For official builds, MSBuild appends the source revision to the informational version:
dotnet/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.GenerateAssemblyInfo.targets
Lines 62 to 71 in 766c39a
Therefore,
dotnet --versionreports:The SDK’s actual directory does not include the SemVer build metadata:
During Stage 2,
OverlaySdkOnLKG.targetscaptures the raw output ofdotnet --version. It then uses that value as an SDK directory name:dotnet/src/sdk/src/Layout/redist/targets/OverlaySdkOnLKG.targets
Lines 57 to 59 in 766c39a
That produces a path that does not exist:
Why the PR’s Stage 2 build passed
The PR did run a genuine Stage 2 build. However, it was a CI build using the simplified
11.0.100-civersioning pattern. The fallback value still matched the physicalsdk/11.0.100-ci/directory, so the bug remained hidden.The official build added the source-revision metadata, exposing the invalid assumption that
dotnet --versioncan always be used directly as an SDK directory name.baronfel commentedon Jul 22, 2026
This should be an easy fix - we already have a mechanism for locating 'the versioned SDK root directory' in the SdkPaths class, we just need to use it on this code path.
dkurepa commentedon Jul 24, 2026
Thanks, looks like this fixed p7. We're still waiting for the main FF to merge