Skip to content

.NET 9 dotnet format Azure DevOps hang #1119

Description

@nietras

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions