79403805

Date: 2025-01-31 19:18:41
Score: 0.5
Natty:
Report link

Not exactly an ideal solution, but adding the following target seems to work:

<Target Name="DisableStyleCop" BeforeTargets="CoreCompile">
  <ItemGroup>
    <Analyzer Remove="@(Analyzer)" Condition="'%(Filename)' == 'StyleCop.Analyzers' OR '%(Filename)' == 'StyleCop.Analyzers.CodeFixes'" />
  </ItemGroup>
</Target>

Thanks to this answer for setting me on the right track.

This workaround would not be not needed if the referenced project had set PrivateAssets="all" when referencing StyleCop. Whether or not this was an oversight or due to heavy-handed stylistic opinions is not clear.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Kyle McClellan