What are the effects of the "EnforceExtendedAnalyzerRules" flag in the project file
Asked Answered
U

1

22

During my work on a Roslyn analyzer I have received an alert from Roslyn analyzer that checks the correct usage of Roslyn API.

RS1036: Specify analyzer banned API enforcement setting.

A project containing analyzers or source generators should specify the property '<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>'.

I tried to google what this property does but did not find any additional information. Here is the link I have already checked:

https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/Microsoft.CodeAnalysis.Analyzers.md#rs1036-specify-analyzer-banned-api-enforcement-setting

Do you know what this flag does?

Undue answered 14/3, 2023 at 13:47 Comment(2)
The chunk of quoted text about RS1036 has a typo: the closing tag has an extra "s". It's a nit. but those of us who copied and then pasted it into a project file wish it were correct.Sitka
Thanks, fixed the mistype, sorry for the inconvenience.Undue
P
19

When this property is set to true, a predefined set of banned symbols are used for the project. You can find the list here (main branch) or here (permalink at the time of writing the answer)

Check this GitHub issue for more details on why this decision was taken.

Petulia answered 17/3, 2023 at 12:36 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.