Conversation
…t 9 so shouldn't be here)
| <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0"> | ||
| <ItemGroup Condition="'$(TargetFramework)' != ''"> | ||
| <!-- Disable for SDK 9 and above --> | ||
| <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" |
There was a problem hiding this comment.
globals.json currently pegs the SDK to 8.0.300. Visual Studio seems to ignore this though and use whatever SDK it comes with, but that only affects when WTG.Analyzers is built directly in VS and not when built with dotnet. None of this will have any effect on the consumers of WTG.Analyzers.
I assume you are trying to address the warning produced when the SDK provides a later version of the analyzer package. This approach means the analyzer package is silently dropped when the SDK version is updated past that point. I think a better solution would be to replace this package reference with EnableNETAnalyzers, then it will use whatever version the SDK provides without having to be separately updated.
There was a problem hiding this comment.
EnableNETAnalyzers is enabled by default in all supported SDKs by now, so we can probably just drop this entirely.
There was a problem hiding this comment.
That doesn't sound like the way they operate, are you sure it isn't set based on target framework?
There was a problem hiding this comment.
ah you're right, it's net5.0 or higher.
Only load V8 rules for lower than 9 SDK (as this SDK already loads it by default, causing duplicate loads)