dotnet / dotnet/Nerdbank.GitVersioning

.NET 9 dotnet format Azure DevOps hang

Open
#1,119 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.6k
Forks
185
Avg merge
1d 1h
Merged PRs (30d)
46

Description

We use GitVersioning for a dotnet project and have without issue for some time. But when upgrading to .NET 9 we suddenly saw `dotnet format --verify-no-changes` hanging forever when running in CI. Not when run manually or locally. After lots of bisecting and removing stuff, we have isolated this to
```xml



```
which is included in `Directory.Build.props`. If this is removes the hang disappears. Only `dotnet format` hangs. No logging output gives any details as to why, but it appears to occur just before dotnet format shows effective editorconfig files for each project. CI output is:
```
D:\agent\_work\_tool\dotnet\dotnet.exe format --verify-no-changes -v diagnostic
The dotnet runtime version is '9.0.0'.
The dotnet CLI version is '9.0.100'.
Using MSBuild.exe located in 'D:\agent\_work\_tool/dotnet\sdk\9.0.100\'.
Formatting code files in workspace 'D:\agent\_work\210\s\Test.sln'.
Loading workspace.
Determining projects to restore...
Restored D:\agent\_work\210\s\src\XYZ\XYZ.csproj (in 198 ms)
```
at which point the task hangs for 60 minutes until Azure DevOps cancels the job.

Presumably, GitVersioning must be doing something during dotnet format that causes the hang and for some reason then only for new .NET 9 SDK perhaps.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.