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
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.146"
PrivateAssets="all" Condition="!Exists('packages.config')" />
</ItemGroup>
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.
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-changeshanging forever when running in CI. Not when run manually or locally. After lots of bisecting and removing stuff, we have isolated this towhich is included in
Directory.Build.props. If this is removes the hang disappears. Onlydotnet formathangs. 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: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.