How can you force StyleCop for ReSharper to ignore files?

醉酒当歌 提交于 2019-12-30 03:03:10

问题


We’ve just been working on introducing StyleCop to our team and are using the StyleCop ReSharper plugin from Code Plex. Problem is, every single file in the project appears to be getting analysed and we can’t find a way to exclude particular files. This includes files such as the designer.cs file from the DBML or third party components included in the project. What this means is your site wide code analysis in ReSharper always shows up errors and you can never get it to go “green”.

There’s always the ExcludeFromStyleCop tag which you can put in the .csproj but this is only used by MSBuild. Right clicking the file in the ReSharper error window and telling it to “Ignore Errors” also doesn’t seem to work; the window just reloads and the same file gets analysed again.

Anyone got any ideas on this?


回答1:


This was what I was looking for, except in Resharper 6 the correct keystroke to disable inspection in a specific file is: Ctrl + Shift + Alt + 8




回答2:


"Are you sure you have have unchecked the StyleCop settings option that specifies stylecop should check designer files? (StyleCop Options > Rules > Detailed Settings > Analyze Designer Files)?"

http://stylecopforresharper.codeplex.com/Thread/View.aspx?ThreadId=47346




回答3:


You can completely disable ReSharper for a particular file by pressing CTRL + 8. You'll see the little 'eye' in the top right of the code window (at the top of the gutter) go grey, indicating it's disabled.

Press the keystroke again to re-enable it.



来源:https://stackoverflow.com/questions/612651/how-can-you-force-stylecop-for-resharper-to-ignore-files

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