FxCop IDE Integration with VS2005 Professional Edition

VS2005 Team System has the capability of seamlessly integrating FxCop inside the IDE. This is also possible with non-Team System versions such as Professional edition by using External Tools - the FxCop documentation for this can be found here:

http://www.gotdotnet.com/team/fxcop/Docs/FxCopCmd/FxCopCmd_VS.html

So what happens if you want to have this convenient IDE integration but point your analysis at an *.FxCop project file rather than pointing directly to assemblies? The main thing you have to do is tell the tool (via the command line) where to look. For example, the easiest solution would be to decide on a "standard" such as always storing your *.fxcop file in the solution root and naming it consistently (e.g., SolutionAnalysis.fxcop). If you do that, then all you have to do to get FxCop to analyze with IDE integration is 1) follow the standard help link from above, and 2) set these command line values:

Title: &FxCop  
Command: C:Program FilesMicrosoft FxCop 1.35FxCopCmd.exe  
Arguments: /console /p:SolutionAnalysis.FxCop  
Initial Directory: $(SolutionDir)  

Once you do that, all your analysis will be displayed in the Output console window within the IDE. What's even nicer is that when FxCop flags you for errors, you can double-click on the message in the console window and it will automatically take you to the offending line of code.

Tweet Post Share Update Email RSS