Skip to content

GenerateToolsSettingsFile races to write DotnetToolSettings.xml in parallel MTFM builds. #47696

@peterwald

Description

@peterwald

Describe the bug

This seems to be a flaky build error caused by the fact the GenerateToolsSettingsFile task writes to the DotnetToolSettings.xml file simultaneously from multiple parallel builds.

##[error].dotnet\sdk\10.0.100-preview.3.25125.5\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.PackTool.targets(98,5): error MSB4018: (NETCORE_ENGINEERING_TELEMETRY=Build) The "GenerateToolsSettingsFile" task failed unexpectedly. System.IO.IOException: The process cannot access the file 'D:\a\_work\1\s\artifacts\obj\Microsoft.Extensions.AI.Evaluation.Console\DotnetToolSettings.xml' because it is being used by another process.

To Reproduce

Here is an example of the error happening in a build pipeline. In this case we have a dotnet tool package being built with 3 TargetFrameworks (net8, net9, net10) and it fails pretty regularly trying to access the file.

Exceptions (if any)

System.IO.IOException: The process cannot access the file 'D:\a\_work\1\s\artifacts\obj\Microsoft.Extensions.AI.Evaluation.Console\DotnetToolSettings.xml' because it is being used by another process.

Further technical details

  • This is happening in a linked Azure DevOps pipeline.
  • The version of the SDK is 10.0.100-preview.3.25125.5.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions