Skip to content

Commit 735a711

Browse files
committed
Conditionalise loading of NetAnalyzers (this is on by default for .net 9 so shouldn't be here)
1 parent 2b23b78 commit 735a711

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/WTG.Analyzers/WTG.Analyzers.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@
88
<Nullable>enable</Nullable>
99
<LangVersion>10</LangVersion>
1010
</PropertyGroup>
11-
<ItemGroup>
12-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
11+
<ItemGroup Condition="'$(TargetFramework)' != ''">
12+
<!-- Disable for SDK 9 and above -->
13+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers"
14+
Version="8.0.0"
15+
Condition="!$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '9.0.100'))" >
1316
<PrivateAssets>all</PrivateAssets>
1417
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1518
</PackageReference>
19+
</ItemGroup>
20+
<ItemGroup>
1621
<PackageReference Include="Nullable" Version="1.3.1">
1722
<PrivateAssets>all</PrivateAssets>
1823
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)