Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AV2210: Require warning level 9999 #121

Closed
bart-degreed opened this issue Aug 2, 2021 · 5 comments · Fixed by #124
Closed

AV2210: Require warning level 9999 #121

bart-degreed opened this issue Aug 2, 2021 · 5 comments · Fixed by #124

Comments

@bart-degreed
Copy link
Contributor

bart-degreed commented Aug 2, 2021

The highest warning level used to be 4, until C# 9 added warning level 5. Microsoft now recommends to use 9999, which should include all future warning levels.

AV2210 should be updated to require level 9999.

@bkoelman bkoelman changed the title AV2210: Require warning level 5 where available AV2210: Require warning level 9999 Sep 12, 2021
@PaulARoy
Copy link

Hi,
We're seeing this warning repeatedly despite having set <WarningLevel>9999</WarningLevel> into the project file.

Could there be any reason why it's still triggering the AV2210?

Thanks,

@bkoelman
Copy link
Owner

This is a known issue in .NET 5, tracked at dotnet/sdk#21599.

@PaulARoy
Copy link

PaulARoy commented Oct 15, 2021

Thank you very much, I did not found that!
What would be the best workaround in your opinion? Completely cancel out AV2210?

(we upgraded to .net5 a few weeks ago and I only got the warning when we updated the nuget package recently so I thought it was coming from it)

@bkoelman
Copy link
Owner

Use the workaround described in the linked issue.

On my machine, Microsoft.NET.Sdk.Analyzers.targets also contains:

<!-- If the user specified 'preview' we want to pick a very high warning level to opt into the highest possible warning wave -->
<WarningLevel Condition="'$(Language)' == 'C#' And '$(AnalysisLevel)' == 'preview'">9999</WarningLevel>

which means you can select 'preview' too.

@bkoelman
Copy link
Owner

bkoelman commented Feb 2, 2022

@PaulARoy I've removed the check on warning level (see 90174ea for motivation), so once the next release has shipped you can remove any earlier workarounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants