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?
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
"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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With