How to install Microsoft’s FxCop for Visual Studio 2010

I recently discovered Visual Studio Achievements, which as the name indicates, adds video game-style “achievements” to Microsoft’s premiere IDE while you code. Visual Studio Achievements was even created by Microsoft’s Channel9 team, so you know it’s the real deal.

Some of the unlockable achievements include positive awards like “Add 10 regions to a class. Your code is so readable, if I only didn’t have to keep collapsing and expanding!” and negative awards such as “Write a single line of code at least 300 characters long. Who needs carriage returns?”. With leaderboards and fun icons, Visual Studio Achievements adds a little fun to your programming experience.

Many of the achievements require a Microsoft tool called FxCop to be installed for them to be unlocked. FxCop is a utility that can analyze your source code and provides feedback on possible design, localization, performance and security improvements. Unfortunately, if you head to the FxCop download page, you’ll quickly learn than the FxCop “download” is actually a text file that tells you to install another file to actually get the application.

When you open the FxCop text file, you’ll be presented with the following information.

FxCop Installation Instructions
1. Download the Microsoft Windows SDK for Windows 7 and .NET Framework 4 version 7.1.
2. Run %ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\FXCop\FxCopSetup.exe to install FxCop.

I know, I was surprised too. For this to work, I need to install the Windows SDK, then install another installer? Well you’re in luck – I took the time to figure out what files were needed so you can install FxCop as quickly as possible. Just follow my instructions below.

Note: This guide is only required if you are using Visual Studio 2010 Professional. If you have Visual Studio 2010 Premium or Ultimate installed, FxCop will already be included with your IDE.

How to install FxCop

Step 1. Download the Microsoft Windows SDK installer.

Step 2. Run the installer. Click “Next” until you get to the “Installation Options” screen.

Step 3. In the Installation Options screen, select only “Tools” under the .NET Development section. You’re free to install other features as well, but “Tools” is the only item that will include the FxCop installer.

windows_sdk_installer

Step 4. Click “Next” and continue following instructions until installation is complete.

Step 5. After the installer finishes, navigate to C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\FXCop.

Run the installer in that folder, FxCopSetup.exe.

After installing FxCop, you’re finished! You can now enjoy the full features of both FxCop and Visual Studio Achievements.

  • http://twitter.com/sombaki Bryant Sombke

    I wish I didn’t do development on numerous VMs for all of our SharePoint projects at work. It would be counter-productive to set this up on every dev environment I use. Pretty cool, though.

  • http://twitter.com/sombaki Bryant Sombke

    I wish I didn’t do development on numerous VMs for all of our SharePoint projects at work. It would be counter-productive to set this up on every dev environment I use. Pretty cool, though.

  • Pingback: VS Achievements and FxCop « count zero()

  • http://www.facebook.com/rcmodely Jiří Herník

    thanks, I used FX cop few years back, but almost forgot I’m missing it :)
    I will probably make the achievements plugin, the official company software 😉

  • http://www.facebook.com/joshuaesau.olguinarredondo Joshua Esau Olguin Arredondo

    Thank youy so much or your user guide of foxCop 2010, Currently I have stared to work with this application and I had never known it before and I hope you continue to publish much more materials like this. Actually I want to know if I can Publish it on my blog this guide because I couldn’t find this information in spanish.

    • http://www.techerator.com/ Evan Wondrasek

       I’m glad you enjoyed the article. Techerator articles cannot be reproduced elsewhere, regardless of translation, but you certainly can link back to this article from your blog.

  • http://twitter.com/huchim Carlos Huchim

    Hi, Microsoft Windows SDK Install throws me a general error and doesn’t install nothing… Do you know where can I download the just the FxCopSetup.exe file?

    thanks in advance

    • Michal C

      You can extract file from SetupWinSDKNetFxToolscab1.cab
      WinSDK_FxCopSetup.exe_all_enu_1B2F0812_3E8B_426F_95DE_4655AE4DA6C6
      and rename to WinSDK_FxCopSetup.exe

      :)

    • Tahir Hassan

      Depending whether your computer is a X86 or X64, uninstall:

      1) Microsoft Visual C++ 2010 X86 Runtime – 10.0.40219
      2) Microsoft Visual C++ 2010 X86 redistributable 10.0.40219
      3) Microsoft Visual C++ 2010 X64 Runtime – 10.0.40219
      4) Microsoft Visual C++ 2010 X64 redistributable 10.0.40219

      … then run the installer again… worked for me.

    • Believe2014

      You can download it from CodePlex: https://fxcopinstaller.codeplex.com

  • Believe2014

    Since FxCop 10.0 is distributed as part of Windows 7 SDK, you have to do some download and extractions to install it on servers which are not running Windows 7.

    https://fxcopinstaller.codeplex.com/