1

does anyone know how to or can provide the syntax for running FxCop via command line.

i want to set a task to run a defined rules.fxcop file (this is a empty project that i made with only a select set of rules enabled to reduce noise and check for things i am interested in)

can someone explain how i can accomplish this...

i am guessing i would need to get latest version of the code and compile the .dll first then somehow get the fxcop project to add the dll as a target and run the analysis. then i want the violations found exported via email or saved to a directory.

ideas?

heisenberg
  • 9,665
  • 1
  • 30
  • 38
kacalapy
  • 9,806
  • 20
  • 74
  • 119
  • This article seems relevant though probably doesn't do everything you want (no custom .fxcop): http://blog.runxc.com/post/2009/04/14/Calling-FxCop-from-MsBuild.aspx For email export you probably want a continuous integration msbuild task, also at that link. – Rup Aug 04 '10 at 13:21
  • using the custom made fxcop project is key because running all the fxcop rules n un-usable report filled with nonsense and false positives. – kacalapy Aug 04 '10 at 13:37

2 Answers2

2

I recommend you pony up and buy all new parts...

Try implementing continous integration with CC.NET. In it you can integrate with NUnit, NDepend, NCover, and FxCop. All of which can be e-mailed to you, displayed on a dashboard, or visible through a program in your tray.

Lucas B
  • 11,793
  • 5
  • 37
  • 50
  • the problem is not CI as i have TFS and can set nightly builds in there. the problem is in ccnet or tfs how do i get a build task to use a fxcop project where i predefine rules to check for and run these against my dll? – kacalapy Aug 04 '10 at 13:43
  • @kacalapy I'm not sure how to do this for TFS, though a quick search in google returned a lot of results, but for CC.NET it is very very easy... http://confluence.public.thoughtworks.org/display/CCNET/Using+CruiseControl.NET+with+FxCop – Lucas B Aug 04 '10 at 13:48
2

Have you tried something like the following:

fxcopcmd.exe /project:"<path to your .fxcop file>" /file:"<path to your target DLL>" /out:"<path to output report>
Nicole Calinoiu
  • 20,843
  • 2
  • 44
  • 49