简体   繁体   中英

Ignore designer and generated files in Resharper analysis

I've been using Resharper for a few days and I really like this tool, but there's one thing that annoys me about it and I wonder if it can be changed.

I'm getting lots of issue notifications from generated code (almost 1400 in my project). I'd want to set those files as ignored so they won't be checked as you can do with StyleCop and CodeAnalysis. Unfortunatelly it looks like Resharper ignores Generated Code settings from it's options because I'm still getting the same notifications. I've tried setting a file mask (ie for *.resx ) and add files manually to generated, but still it doesn't change anything.

I don't know if it matters but I'm using VS 2010.

I've just received an answer for this from ReSharper support:

In order to skip those files during code inspection you should open ReSharper > Options > Code Inspection > Settings, press 'Edit items to skip' and add your files to that list.

I agree with RaYell's answer; to ignore those files completely, you'll need to add them to Items to Skip .

Here is some more useful information:

What makes Generated Code different from Items to Skip ?

The entries on [the Generated Code page], which do allow masks (as well as regions), do get analyzed, yet no hints, warnings, suggestions or quick fixes are offered since it does not make much sense. However, and this is important , files still do get analyzed to provide error information and completion. This is what makes Generated Code different from Items to Skip .

http://blogs.jetbrains.com/dotnet/2011/06/preventing-items-from-being-analyzed-in-resharper/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM