Rules defined by FXCop
fig: Report generated by FXCop.
Integrate with Visual studio
In the Visual Studio .NET IDE, navigate to Tools -> External Tools option;
on click of External tool one new dialog box would open.click on Add button to display the new configuration dialog box as below:
fig: Adding FXCop to External tollOn new windows set the parameter as below:
1. ADD: Click on ADD button to add an Fxcop as external tool
2. Title: provide an external toll name (something like FxCop).
3. Command: To set the value of the Command text box, browse to the location where FxCop
is installed, and select FxCopCmd.exe. (in my case it is at
C :\Program Files\Microsoft FxCop 1.36\FxCopCmd.exe)
Files\Microsoft FxCop 1.36\Rules" /consolexsl:"C:\Program
Files\Microsoft FxCop 1.36 \Xml\VSConsoleOutput.xsl"
Some key arguments explained below:
• /c direct FXCop analysis to console or output window in IDE.
Library (DLL), or a directory to browse for target assemblies
Corresponding FXCop project file.
• /s - Indicates FXCop to include the summary report with the informational message. • /r:
5. Initial Directory : Set the Initial Directory to the location where FxCopCmd should start.
("C:\Program Files\Microsoft FxCop 1.36")
6. Select the Use Output window check box.
7. Click OK.
at last we have integarted FXCop to our VS.Net.
Now to Run this FXCop for Code Review analysis Click on Tools, under drop down menu select FXCop as shown below:
On click of FXCop ,the FXCop Engine would start Analysis our code w.r.t selected Rules and The analysis results will be posted in the "Output Window" of VS with the rule name, code file name, and error details as shown below ,The developer can click on the relevant FXCop error and navigate to the source-code to understand the problem and then fix it.
Please feel free to put some comments.