Ignore designer and generated files in Resharper analysis

孤者浪人 提交于 2019-12-07 06:54:45

问题


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 (i.e. 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.


回答1:


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.




回答2:


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/



来源:https://stackoverflow.com/questions/3005693/ignore-designer-and-generated-files-in-resharper-analysis

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