ReSharper 2021.2 Help

Generated Code

ReSharper | Options | Code Inspection | Generated Code

On this page of ReSharper options, you can specify files and code regions containing automatically generated code. For these items, ReSharper runs only those code inspections that check code for compiler errors and warnings. Some file masks and regions, which are typically used for generated code, for example *.designer.cs are included in this list by default, but you can change the default settings if necessary.

If you use .editorconfig in your solution, you can also mark generated code using the generated_code property. For example:

[*generated.cs] generated_code = true

You can use the following wildcards in file masks:

  • ? to match one character

  • * to match one or more characters

  • ** to match files and folders recursively

The list of items containing generated code can also be used for disabling code cleanup for generated code.

Last modified: 12 July 2021