Integrate FxCOP in the VS


This Tip gives a view about how to integrate FxCOP in VS

Those who don’t have VS Code analysis can integrate FxCOP in the VS.

Assumes you have FxCop 1.36 installed in the default folder. If you haven’t done this yet, you can do it now as it will help in code review.

Follow the steps below to set this up.

In Solution Explorer, right-click on your project and choose Properties
For C# projects, in the Project Properties window, select the Build Events tab
For Visual Basic projects, in the Project Properties window, select the Compile tab, and click Build Events
In the Post-build event command-line text box, enter the following (assuming you installed FxCop to the default location):

"%ProgramFiles%\Microsoft FxCop 1.36\FxCopCmd.exe" /file:"$(TargetPath)" /console
In Solution Explorer, right-click on your project and choose Build
Any FxCop violations will now appear as build warnings:


Comments

Author: Anil Kumar Pandey08 Jan 2010 Member Level: Diamond   Points : 2

Good Information,

but please put this in the resource section....



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: