ReSharper 2021.1 Help

Ignore Parts of the Code

In most solutions, there are parts of the code where you want to disable some or all of ReSharper features. This topic lists all available ways to make ReSharper ignore specific of the code.

Ignore projects with frozen or third-party code

ScenarioImprove performance by not indexing and not analyzing projects that contain third-party or frozen code, which is not going to be changed.
How to ignoreList file masks of the projects that should be ignored (for example, Project*.csproj) under Projects to ignore on the Code Inspection | Ignored Code page of ReSharper options (Alt+R, O).
What is disabledAlmost all ReSharper features, for example Code Analysis, Code Completion (IntelliSense), Refactorings, Code Generation.
What is availableAfter you build projects ignored in this way, symbols from that projects will be recognized by Code Analysis and Code Completion (IntelliSense) in other projects, and they will also be available via navigation and search.

Disable code inspection for parts of the code

ScenarioMinimize unwanted results in design-time code inspection and code inspection in specific scope by ignoring parts of code that you are not going to improve.
How to ignore
  • List specific files and folders or file masks (for example, Test*.cs) under Elements to skip on the Code Inspection | Ignored Code page of ReSharper options (Alt+R, O).

  • To ignore the current file, press Control+Alt+Shift+D8.

  • To ignore a part of a file, add the // ReSharper disable All comment before the ignored part and // ReSharper restore All after it.

What is disabledAll code inspection features as well as Structural Search and Replace.

Disable code inspections with lower severity levels in generated code

ScenarioIgnore generated parts of the code to minimize unwanted results in design-time code inspection and code inspection in specific scope but do not ignore errors and warnings in that parts to make sure that the generated code compiles.
How to ignoreList specific files and folders, file masks, or names of regions containing generated code on the Code Inspection | Generated Code page of ReSharper options (Alt+R, O).
What is disabledCode inspections with lower severity levels as well as code cleanup.

Exclude files and folders from navigation and search results

ScenarioRemove unwanted items from the results of search and navigation.
How to ignoreList specific files and folders or file masks (for example, Test*.cs) under Elements to skip on the Environment | Search & Navigation page of ReSharper options (Alt+R, O).
What is disabledAll navigation and search commands except Go to Declaration and Go to Type of Symbol, which will be available on usages of symbols from the ignored files.

Ignore implicitly used files (C++ and Web languages)

ScenarioCompletely ignore files that are implicitly used in your project to improve performance and minimize unwanted results in code analysis and navigation.
Such files would normally be recognised as C++, JavaScript, TypeScript or JSON. For example, generated, minified files, implementations of third-party components that must be included in your project, or scripts that were already gzipped.
How to ignoreList specific files and folders or file masks (for example, *.min.js) under Skipped code on the Code Editing | Third-party code page of ReSharper options (Alt+R, O).
What is disabledAll ReSharper features in these files.
If symbols from these files have direct usages in other places, these usages will not be resolved and highlighted as errors.

Disable code analysis and refactorings in library code (C++ and Web languages)

ScenarioMinimize unwanted results in design-time code inspection and code inspection in specific scope by ignoring parts of code that you use directly but do not maintain, such as jquery.js.
How to ignoreList specific files and folders or file masks (for example, *.ref.js) under Library code on the Code Editing | Third-party code page of ReSharper options (Alt+R, O).
What is disabledCode inspection to this code and will not try to modify this code with quick-fixes and refactorings.
What is availableSymbols from ignored files will be recognized by Code Analysis and Code Completion (IntelliSense) in other files, and they will also be available via navigation and search.
Last modified: 08 April 2021