Excluding specific files from FxCop analysis

I wonder if someone else has faced this issue; I have setup a new FxCop build config which analyses the output of a build but the stats look way out of proportion because the automatically generated * .XmlSerializers.dll are included in the analysis.

This is the way I set it up: I created a Artefact dependency "build/** => ." and in the FxCop configuration I have specified the assemblies to inspect using a wildcard: "build\bin\*.*".
I know I could avoid using wildcards and list each file I would like to analyse but that's not practical for a number of reasons, I would like to be able to exclude specific files instead. Is there are way to do this?


3 comments
Comment actions Permalink

Unfortunately, no if you want to use FxCop runner. I filled an issue: http://www.jetbrains.net/tracker/issue/TW-9483

As for workaround I suggest to run FxCop from a build file (i.e. MSBuild) and import results through service messages. It's not user-friendly as TeamCity build runner, but enables unlimited ways for customization.

See http://www.jetbrains.net/confluence/display/TCD4/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingFxCop for documentation..

0
Comment actions Permalink

I will try to generate a FxCop report in MSBuild as part of the build as suggested here and then use the FxCop runner specifying the project rather than a list of files.

Thanks anyway for the clarification.

Alex

0
Comment actions Permalink

I had to revert back to include the FxCop analysis in the actual MSBuild run as creating the FxCop project did not work. That's a real shame as it would be good to separate the compilation from the code analysis and expecially be able to fail the build if the number of error/warnings exceeds a given threshold.

0

Please sign in to leave a comment.