Welcome to MSDN Blogs Sign in | Join | Help

FAQ: How do I prevent FxCop 1.36 from firing warnings against generated code?

I've upgraded from FxCop 1.35 to 1.36 and now FxCop has started to fire warnings against typed DataSets and other generated code. How do I turn this off?

The reason this is occurring is because we changed the way that FxCop analyzed generated code. Whereas previously in 1.35, FxCop would only ignore particular generated code (such as DataSets), FxCop 1.36 will now either ignore no generated code, or all generated code. The former is the default.

To change this behavior and have FxCop skip over generated code:

Using an FxCop project:

  1. Open your FxCop project in FxCop
  2. Choose Project -> Options -> Spelling & Analysis
  3. Check Suppress analysis results against generated code
  4. Click OK

Via the command-line:

  1. Pass the /ignoregeneratedcode switch, for example:

    FxCopCmd.exe /file:MyAssembly.dll /out:AnalysisResults.xml /ignoregeneratedcode

For more information on FxCop's behavior over generated code, see Correct usage of the CompilerGeneratedAttribute and the GeneratedCodeAttribute.

Published Thursday, February 28, 2008 10:39 AM by David M. Kean
Filed under: , ,

Comments

# Daily Bits - February 29, 2008 | Alvin Ashcraft's Daily Geek Bits

Monday, May 05, 2008 6:21 AM by KjellSJ

# re: FAQ: How do I prevent FxCop 1.36 from firing warnings against generated code?

How to do this from within VisualStudio2005? What is the format of the XML config to do this in the .csproj file?

Sunday, August 17, 2008 11:21 PM by Dave's Box

# FxCop 1.36 Released!

After what has to be the longest beta period of a product (after Gmail) - we've finally released

Sunday, September 07, 2008 8:54 PM by Blake Niemyjski

# FxCop 1.36 Released

After a very long time, an FxCop update has been released . Here is a list of all that has changed: 200

Friday, September 12, 2008 4:28 AM by Joycode@Ab110.com

# FxCop 1.36发布了

【原文地址】 FxCop 1.36 Released 【原文发表日期】 20 August 08 08:49 David Kean宣布了 FxCop 1.36的发布 从David的博客中我们能看到以下几处优点

Friday, January 30, 2009 6:17 AM by DotNetShoutout

# Code Analysis Team Blog : FAQ: How do I prevent FxCop 1.36 from firing warnings against generated code?

Thank you for submitting this cool story - Trackback from DotNetShoutout

New Comments to this post are disabled
 
Page view tracker