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 parts of the code.
Ignore projects with frozen or third-party code
Scenario | Improve performance by not indexing and not analyzing projects that contain third-party or frozen code, which is not going to be changed. |
How to ignore | List file masks of the projects that should be ignored (for example, Project*.csproj) under Projects to ignore on the page of ReSharper options(Alt+R, O). |
What is disabled | Almost all ReSharper features, for example Code Analysis, Code Completion (IntelliSense), Refactorings, Code Generation. |
What is available | After 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
Scenario | Minimize 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 |
|
What is disabled | All code inspection features as well as Structural Search and Replace. |
Disable code inspections with lower severity levels in generated code
Scenario | Ignore 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 ignore | List specific files and folders, file masks, or names of regions containing generated code on the Alt+R, O). | page of ReSharper options(
What is disabled | Code inspections with lower severity levels as well as code cleanup. |
Exclude files and folders from navigation and search results
Scenario | Remove unwanted items from the results of search and navigation. |
How to ignore | List specific files and folders or file masks (for example, Test*.cs) under Elements to skip on the page of ReSharper options(Alt+R, O). |
What is disabled | All 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)
Scenario | Completely 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 ignore | List specific files and folders or file masks (for example, *.min.js) under Skipped code on the page of ReSharper options(Alt+R, O). |
What is disabled | All 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)
Scenario | Minimize 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 ignore | List specific files and folders or file masks (for example, *.ref.js) under Library code on the page of ReSharper options(Alt+R, O). |
What is disabled | Code inspection to this code and will not try to modify this code with quick-fixes and refactorings. |
What is available | Symbols 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: 13 July 2021