Skip to content

TargetFramework net7.0 disables all CAxxxx rules #6245

@znakeeye

Description

@znakeeye

Just bumped my project to .NET 7.0 RC2 (running VS Version 17.4.0 Preview 6.0), and realized that all code analysis rules are disabled, no matter the settings. Downgrading the project to net6.0 re-enables all CAxxxx rules.

Steps To Reproduce

Just create a console project with some CAxxxx violations, and target net7.0. No warnings are produced. Downgrade to net6.0 to get the warnings back.

<PropertyGroup>
   <!--TargetFramework>net6.0</TargetFramework-->
   <TargetFramework>net7.0</TargetFramework>

   <OutputType>Exe</OutputType>
   <LangVersion>latest</LangVersion>
   <ImplicitUsings>enable</ImplicitUsings>
   <Nullable>enable</Nullable>
   <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
   <AnalysisMode>AllEnabledByDefault</AnalysisMode>
   <WarningLevel>9999</WarningLevel>
</PropertyGroup>

Expected behavior

CAxxxx rules are checked when targeting .NET 7.

Actual behavior

CAxxxx rules are checked only when targeting .NET 6 or earlier.

Metadata

Metadata

Assignees

Labels

BugThe product is not behaving according to its current intended designPriority:0Critical to the releaseReliabilityIndicates a reliability issue (crash/data loss/test flakiness)Urgency-Soon

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions