Skip to content

MSB4242: SDK Resolver Failure due to System.Threading.AbandonedMutexException #28488

@breidikl

Description

@breidikl

Describe the bug

Updating our build environment to use .NET 6 SDK 6.0.402 (from 6.0.401) and the associated 6.0.10 runtime packages is now resulting in intermittent failures as follows during dotnet restore calls:

Name.csproj : error MSB4242: SDK Resolver Failure: "The SDK resolver "NuGetSdkResolver" failed while attempting to resolve the SDK "Office.Build.Before". Exception: "System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.
Name.csproj : error MSB4242: at System.Threading.WaitHandle.WaitOneNoCheck(Int32 millisecondsTimeout)
Name.csproj : error MSB4242: at System.Threading.WaitHandle.WaitOne(TimeSpan timeout, Boolean exitContext)
Name.csproj : error MSB4242: at NuGet.Common.Migrations.MigrationRunner.Run()
Name.csproj : error MSB4242: at Microsoft.Build.NuGetSdkResolver.NuGetSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory)
Name.csproj : error MSB4242: at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IList`1 resolvers, Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult)"

"Name" varies build to build and appears to be a random set of csproj files being restored for each build. We have not been able to repro when rebuilding the same projects locally for the same environment.

Using 6.0.401 (with the 6.0.9 runtime packages) did not hit this with everything else in our environment being the same.

Further technical details

We are currently using MSBuild 17.3.4, and running "dotnet --info" shows the following:

.NET SDK (reflecting any global.json):
Version: 6.0.402
Commit: 6862418

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win10-x64
Base Path: dotnetsdkbootstrapper\sdk\sdk\6.0.402\

global.json file:
\global.json

Host:
Version: 6.0.10
Architecture: x64
Commit: 5a400c212a

.NET SDKs installed:
3.1.424 [dotnetsdkbootstrapper\sdk\sdk]
5.0.408 [dotnetsdkbootstrapper\sdk\sdk]
6.0.402 [dotnetsdkbootstrapper\sdk\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.30 [dotnetsdkbootstrapper\sdk\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [dotnetsdkbootstrapper\sdk\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.10 [dotnetsdkbootstrapper\sdk\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.30 [dotnetsdkbootstrapper\sdk\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [dotnetsdkbootstrapper\sdk\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.10 [dotnetsdkbootstrapper\sdk\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.30 [dotnetsdkbootstrapper\sdk\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [dotnetsdkbootstrapper\sdk\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.10 [dotnetsdkbootstrapper\sdk\shared\Microsoft.WindowsDesktop.App]

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions