-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-AnalyzersuntriagedIssues and PRs which have not yet been triaged by a leadIssues and PRs which have not yet been triaged by a lead
Description
Version Used:
SDK 7.0.100 with Visual studio 17.4.1
Steps to Reproduce:
- Install .NET6 SDK and .NET 7 SDK in parallel (latest versions)
- Create a C# project with a global.json selecting .NET6
- Use <AnalysisLevel>latest-all</AnalysisLevel> in csproj
- Using some example code, targeting .NET48 with <EnableNETAnalyzers>true</EnableNETAnalyzers>
- Verify the number of code analysis warnings. E.g. 97 warnings
- Switch to .NET7 using global.json, rebuild
- The number of code analysis warnings decreases to about the same number as with <AnalysisLevel>latest-recommended</AnalysisLevel>
Diagnostic Id:
For example, CA2007 should be enabled in "latest-all", but is not in .NET7
Expected Behavior:
In .NET7, at least the same number of code style warnings should be visible as in .NET 6.
Actual Behavior:
latest-all has not the same effect in .NET 7
Workaround
With this global.json, I can still use C#11 features (with VS17.4) and all analyzers are working:
{
"sdk": {
"allowPrerelease": false,
"version": "6.0.0",
"rollForward": "latestMinor"
}
}
Metadata
Metadata
Assignees
Labels
Area-AnalyzersuntriagedIssues and PRs which have not yet been triaged by a leadIssues and PRs which have not yet been triaged by a lead