Skip to content

Conversation

@rolfbjarne
Copy link
Member

The .stamp-workload-replace-* targets delete SDK workload manifests and
workloadsets directories while .stamp-workaround-for-maccore-issue-2427
runs 'dotnet restore' concurrently, causing the SDK's workload manifest
resolver to crash with:

error MSB4242: SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Microsoft.NET.SDK.WorkloadManifestTargetsLocator". Exception: "System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.Aggregate[TSource](IEnumerable`1 source, Func`3 func)
   at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.ResolveManifestDirectory(String manifestDirectory)
   at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.<>c__DisplayClass35_0.<FallbackForMissingManifest>b__5(ValueTuple`2 t)
   at System.Linq.Enumerable.IEnumerableWhereSelectIterator`2.MoveNext()
   at System.Linq.Enumerable.IEnumerableWhereIterator`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.FallbackForMissingManifest(String manifestId)
   at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.GetManifests()
   at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, IWorkloadManifestProvider manifestProvider, IWorkloadResolver workloadResolver)
   at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir, String globalJsonPath)
   at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IReadOnlyList`1 resolvers, Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult, IEnumerable`1& errors, IEnumerable`1& warnings)""

Add $(INSTALLED_SDK_MANIFESTS) as a dependency to ensure the full
workload replacement cycle (delete old manifests, create symlinks to
local workloads) completes before the restore runs.

The .stamp-workload-replace-* targets delete SDK workload manifests and
workloadsets directories while .stamp-workaround-for-maccore-issue-2427
runs 'dotnet restore' concurrently, causing the SDK's workload manifest
resolver to crash with:

```
error MSB4242: SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Microsoft.NET.SDK.WorkloadManifestTargetsLocator". Exception: "System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.Aggregate[TSource](IEnumerable`1 source, Func`3 func)
   at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.ResolveManifestDirectory(String manifestDirectory)
   at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.<>c__DisplayClass35_0.<FallbackForMissingManifest>b__5(ValueTuple`2 t)
   at System.Linq.Enumerable.IEnumerableWhereSelectIterator`2.MoveNext()
   at System.Linq.Enumerable.IEnumerableWhereIterator`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.FallbackForMissingManifest(String manifestId)
   at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.GetManifests()
   at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, IWorkloadManifestProvider manifestProvider, IWorkloadResolver workloadResolver)
   at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir, String globalJsonPath)
   at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IReadOnlyList`1 resolvers, Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult, IEnumerable`1& errors, IEnumerable`1& warnings)""
```

Add $(INSTALLED_SDK_MANIFESTS) as a dependency to ensure the full
workload replacement cycle (delete old manifests, create symlinks to
local workloads) completes before the restore runs.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a parallel make race condition where SDK workload manifest deletion and dotnet restore could run concurrently, causing MSBuild SDK resolver crashes. The fix introduces a new variable INSTALLED_SDK_MANIFESTS to track SDK manifest symlink creation and adds it as a dependency to ensure the complete workload replacement cycle finishes before restore runs.

Changes:

  • Introduce INSTALLED_SDK_MANIFESTS variable to track SDK manifest installation targets
  • Add INSTALLED_SDK_MANIFESTS as a dependency to .stamp-workaround-for-maccore-issue-2427 to prevent race condition

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #48a6c9d] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 48a6c9d7d143e89bf24f68a29be89d62f4a6c5ef [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #48a6c9d] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 48a6c9d7d143e89bf24f68a29be89d62f4a6c5ef [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 48a6c9d7d143e89bf24f68a29be89d62f4a6c5ef [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #48a6c9d] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 48a6c9d7d143e89bf24f68a29be89d62f4a6c5ef [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #48a6c9d] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 48a6c9d7d143e89bf24f68a29be89d62f4a6c5ef [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #48a6c9d] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 48a6c9d7d143e89bf24f68a29be89d62f4a6c5ef [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #48a6c9d] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 48a6c9d7d143e89bf24f68a29be89d62f4a6c5ef [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #48a6c9d] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 48a6c9d7d143e89bf24f68a29be89d62f4a6c5ef [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne marked this pull request as ready for review February 11, 2026 16:11
@rolfbjarne rolfbjarne enabled auto-merge (squash) February 11, 2026 16:11
@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #48a6c9d] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: 48a6c9d7d143e89bf24f68a29be89d62f4a6c5ef [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #48a6c9d] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 117 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 9 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download

Pipeline on Agent
Hash: 48a6c9d7d143e89bf24f68a29be89d62f4a6c5ef [PR build]

@rolfbjarne rolfbjarne merged commit 078caf2 into main Feb 12, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants