9

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?

SENya
  • 1,083
  • 11
  • 26
  • 1
    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. – Rich Armstrong Jun 22 '23 at 18:24
  • Thanks, fixed the mistype, sorry for the inconvenience. – SENya Jun 23 '23 at 19:57

1 Answers1

8

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.

Youssef13
  • 3,836
  • 3
  • 24
  • 41