Excluding files from FxCop analysis

Is there any way to exclude files from analysis using FxCopCmd   We have a solution that uses a COM DLL via interop, so when FxCop analyses the project output it reports this as an error.  We are using an automated build script (NAnt), so I want to avoid specifying the individual file names to check (as it is one file among about 20 in the output) if I can.  I can ignore the warning in Nant, but I'd love to have a "clean" solution :>

Answer this question

Excluding files from FxCop analysis

  • Marcos Nunes

    So, you have a scripted solution that attempts to analyze all your project targets And on analyzing your COM DLL, FxCop reports an error stating that it can't analyze that binary

    FxCop currently doesn't have a 'silent' mode which will help out here. You'll need to special-case the file or otherwise alter your build model to ignore it. Internally here at MS, our scripted build systems have a per-project setting that indicates whether analysis should occur. I'd guess you could contrive something similar for Nant but, unfortunately, I don't have the expertise to offer a good suggestion on how to do so. 8)



  • AlainDe

    I have the same need!

    I produces a huge pile of code based on a xml file, that I don't maintain. These files are included in one of my projects and floods the fxcop output.

    It would have been nice to be able to specify some files through the project file which fxcop should ignore.

    One solution is of cause to have the files that I want to ignore in a seperate project and then disable fxcop for that project.

  • rabbitoh

    Ahhh OK, that's a pity.  Is there a feature request area somewhere for FxCop   I think this could be a handy feature.  Does VSTS have a new version of FxCop coming out

    Thanks for the reply! :)

  • Excluding files from FxCop analysis