Skip to content

Commit 20e285c

Browse files
committed
Avoid dotnet format hang
Workaround dotnet/sdk#44951
1 parent 64483bf commit 20e285c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Directory.Packages.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
<ItemGroup>
1414
<GlobalPackageReference Include="CSharpIsNullAnalyzer" Version="0.1.593" />
1515
<GlobalPackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" />
16-
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.146" />
16+
<!-- The condition works around https://github.com/dotnet/sdk/issues/44951 -->
17+
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.146" Condition="!('$(TF_BUILD)'=='true' and '$(dotnetformat)'=='true')" />
1718
<GlobalPackageReference Include="Nullable" Version="1.3.1" />
1819
<GlobalPackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556" />
1920
</ItemGroup>

azure-pipelines/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ jobs:
3737
- template: dotnet.yml
3838
parameters:
3939
RunTests: ${{ parameters.RunTests }}
40-
- script: dotnet format --verify-no-changes --no-restore
40+
- script: dotnet format --verify-no-changes
4141
displayName: 💅 Verify formatted code
42+
env:
43+
dotnetformat: true # part of a workaround for https://github.com/dotnet/sdk/issues/44951
4244
- template: expand-template.yml
4345

4446
- job: macOS

0 commit comments

Comments
 (0)