Is there a way to disable resharper code analysis for a single file using a comment?

。_饼干妹妹 提交于 2019-12-23 02:28:42

问题


Is there a way to disable resharper code analysis for a single file using a comment?

I'm generating code with 100's of class in a single file and I'd rather not have resharper to code analysis on that file.

I'm talking about the following:

https://www.jetbrains.com/help/resharper/2016.1/Speeding_Up_ReSharper.html#d235354e43

Disable code analysis for specific files

You can tell ReSharper to skip analyzing certain files without opening them. For example, you can skip files that contain well tested algorithms and that do not change much. To do so, go to ReSharper | Options | Code Inspection | Settings and scroll to the Element to skip section, where you can pick the files and folders to skip. You can also specify a file mask for skipping files. You will also notice that all files where you disabled code analysis with Ctrl+Shift+Alt+8 are already in the list of ignored files.


回答1:


If you're talking about inspections (excluding errors), the answer would be:

// ReSharper disable All

At the top of the file.



来源:https://stackoverflow.com/questions/38748741/is-there-a-way-to-disable-resharper-code-analysis-for-a-single-file-using-a-comm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!