Coffeehouse Thread

31 posts

How I downloaded and installed FxCop.

Back to Forum: Coffeehouse
  • User profile image
    Bas

    I needed to get FxCop on my machine today, but I had no idea where to get it, so just Googled 'FxCop'. The first result was this Msdn page that had lots of info on FxCop but no download link. I scanned the text and found a link to what was referred to as 'the FxCop website' for "support, updated documentation and new rule topics". Note that this does not say "downloads", but I tried my luck anyway. What was falsely claimed as being the FxCop website was actually a nonexistant page on Microsoft Downloads that said "no results found for downloads details aspx familyid 9AEAA970 F281 4FB0 ABA1 D59D7ED09772 displaylang en" which doesn't make any sense whatsoever.

     

    I then Googled some more and found the Code Analysis Team Blog. Sounds about right, doesn't it? It looked like the right place, because if a code analysis tool like FxCop doesn't come from the Code Analysis Team then where else would it come from? My hunch was apparently proven correct because I saw a big FxCop link in the tag cloud. Imagine my surprise when the most recent post tagged 'FxCop' was from november 2008. The third post in the list of results was the announcement of the release of FxCop 1.36, which I had learned (and assumed from the 2008 date) was not the latest version.

     

    Angry and frustrated, I returned to Microsoft Downloads and searched for FxCop, which that MSDN page could have done in the first place if it was going to send me to Microsoft Downloads anyway instead of where it said it would send me and wasn't daft enough to search for part of a url instead of the product I was looking for. My search initially seemed disastrous: the first search result was neither the most recent, nor the most relevant, nor the most popular, so obviously they made it the top search result. Incidentally, it makes total sense that you should sort your results on least popular result first by default.

     

    My pulse quickened, however, when I saw the second search result simply titled "FxCop 10.0". The version on the Code Analysis Team Blog was apparently more obsolete than I had first imagined since we've apparently had nine major version changes since that time. Happily, I clicked the link and got sent to a download page, ready to finally download and install what I could only assume was the latest version of FxCop.

     

    Alarmingly, the download didn't prove to be for an .msi or .exe or even .zip file. In fact, it was not a download for FxCop 10.0 at all, despite what the download page claimed. It was a download for a textfile called "readme.txt". Baffled, I opened the text file and found what were amusingly titled "FxCop installation instructions."

     

    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.

     

    Yes, the download for FxCop was actually a download for a text file that told me I had to go somewhere else and download something entirely different. It could've said this on the webpage, but why take advantage of this 20 year old medium if you can also just make people download a text file. Note also that it doesn't exactly tell me where to download the Windows SDK, just that I should go do it. It kind of felt like a huge ANSI bird was being flipped at me, but then again if there had been a url in there it would probably have sent me to another nonexistant Microsoft Downloads page again.

     

    Also note how the installer for the SDK doesn't actually install FxCop, but installs an installer that you can use to then install FxCop.

     

    I fortunately found a link to the SDK on the 'thank you for downloading' page, under 'related links'. This is kind of a misnomer, because it was not really a related link, but more the actual link to what I was told I was going to download in the first place.

     

    The installer fortunately provided me a way to customize the install. Since I only wanted FxCop, I unchecked everything and then looked for the "FxCop Installer" checkbox. This was foolish, because there obviously wasn't going to be a thorough description of the items you could install. In the end I assumed it must be in the 'Tools' option under '.NET Development', because it sure wasn't going to be under 'Native Code Development' or 'Redistributable Packages' and none of the options under 'Common Utilities' seemed like they would be it. In an amazing stroke of luck, this later proved to be correct.

     

    I ran the installer for FxCop - I mean, I ran the installer for the installer for FxCop - and sure enough, when it had finished and I had manually searched through a bin directory in program files, there it was: fxcopsetup.exe. I ran it and lo: FxCop 10.0 is now happily buzzing away on my system. I still had to uninstall the SDK - something I hadn't wanted to install in the first place - but that seemed trivial in the light of my ultimate succes, even if it consisted of uninstalling the SDK and then uninstalling the stray Visual C++ 2010 redistributable it had left behind on my system.

     

    So let's recap: after several fruitless searches broken pages and misinformation, I had found what I was led to believe to be the installer for FxCop but was actually just a text file that told me what I needed to download but not where to download it, which would install a piece of software that I would then have to run to install what I was told the text file was going to be in the first place. It is like a diabolical matryoshka doll of software, designed by satan himself with the sole intent of reducing those who just want to check their coding standards to a shivering mess of tears and useless browser history.

     

    Throughout that whole process, I was reminded of that infamous Bill Gates email from 2003 in which he was futilely trying to download Movie Maker. I wonder what Bill thinks of the fact that somebody's endeavour to download a simple piece of software that ought to be readily available to anyone trying to write decent code would be so fraught with peril, and that it would take that person twelve paragraphs and just over a thousand words to describe what any reasonable person would expect to be a simple matter of "find website, download latest version, install".

     

    Oh, remember how I said that FxCop was happily buzzing away on my system? That's.. not entirely true. When I had it check for updates - who knows, there might be an FxCop 20.0 by now - I got the message that FxCop was unable to check for updates because '--' was found in FxCop.exe.config where '>' should have been. This was apparently happening on line 81, a line that doesn't exist in a 64 line XML document. Maybe I can find an updated config file on Microsoft Downloads...

  • User profile image
    blowdart

    Ouch. One of my colleagues works with the FXCop team - I'll pass this on.

  • User profile image
    Sven Groot

    It could've said this on the webpage

    Not that it makes your journey any less rediculous, but it does actually say that on the same webpage where you download the text file. In a way that's even more rediculous: it's a download page for a text file whose contents are actually also on that very same page.

     

    And the jump in version number is probably to equalize it with Visual Studio.

     

    But why on earth you can't download the installer separate from the Windows SDK, I have no idea.

  • User profile image
    W3bbo

    Sven Groot said:

    *snip*

    Not that it makes your journey any less rediculous, but it does actually say that on the same webpage where you download the text file. In a way that's even more rediculous: it's a download page for a text file whose contents are actually also on that very same page.

     

    And the jump in version number is probably to equalize it with Visual Studio.

     

    But why on earth you can't download the installer separate from the Windows SDK, I have no idea.

    It's the same with the other tools: WinDiff, UI Spy, etc... they're all only available as part of the multi-gigabyte SDK download.

     

    Weirdness: the IA-64 compiler is only included in the expensive versions of VS, yet is included for free with the Windows SDK.

  • User profile image
    Bas

    W3bbo said:
    Sven Groot said:
    *snip*

    It's the same with the other tools: WinDiff, UI Spy, etc... they're all only available as part of the multi-gigabyte SDK download.

     

    Weirdness: the IA-64 compiler is only included in the expensive versions of VS, yet is included for free with the Windows SDK.

    To be fair, the SDK installer was only a few megs and once all the options except for 'tools' were disabled, the download itself was only 80 megs or so. But yeah, why they only come as part of the SDK is a mystery.

     

    And Sven: you're right, that's even crazier than I realized.

     

    Blowdart: thanks! I wonder what they'll say.

  • User profile image
    reidca

    Bas said:
    W3bbo said:
    *snip*

    To be fair, the SDK installer was only a few megs and once all the options except for 'tools' were disabled, the download itself was only 80 megs or so. But yeah, why they only come as part of the SDK is a mystery.

     

    And Sven: you're right, that's even crazier than I realized.

     

    Blowdart: thanks! I wonder what they'll say.

    I found this article the other day whilst trying to do exactly what you wanted to do, download and install FXCop 10. I too was amazed at the hoops I had to jump through to do what should be a simple thing. A simple download and install! Brilliant write up by the way, made me laugh all the way through.  Big Smile

     

    I tried an alternative approach at first after reading that you can download the ISO version of the SDK and extract the files needed without performing a full install. See http://blogx.co.uk/ViewItem.asp?Entry=812. I really did not want to install the Windows 7 SDK, I mean I am still using Windows XP so can't really see the reasoning behind this being in the Windows 7 SDK at all!!

     

    This however fails for 2 reasons. The first is that .NET framework 4.0 is required. This I found really strange because the directory the cab files are in is called WinSDKNetFxTools however there is another directory called WinSDKNetFx40Tools. Is it silly to expect that tools requiring the .NET framework 4 might be in a directory called WinSDKNetFx40Tools and that the tools in the other directory should not need framework 4? It appears so because the installation of FXCop fails if you do not have framework 4 installed.

     

    So, I installed framework 4 and then installed FXCop from the file extracted from the setup cab. The installation goes fine however each time the tool is run you get a runtime error stating the "Microsoft.VisualStudio.CodeAnalysis.Interop.dll" could not be found. After several fruitless searches, I reluctantly installed the tool using the SDK setup which it appears also installs the required assembly.

     

    I found the entire process nothing short of a calamity. Honestly Microsoft have taken giant steps forward in the development arena, especially the work Scott Gutheries team have done, however things like this lead to an incredible amount of frustration and despair for developers. I do hope someone from Microsoft reads this page and considers how they might make our lives a little easier in the future!

     

     

     

     

     

     

  • User profile image
    jockeyjp

    just went through the same mess trying to find it as well. Stumbled upon this link though that actually does have a download for the installer for version 1.35

    http://code.msdn.microsoft.com/codeanalysis/Release/ProjectReleases.aspx?ReleaseId=553

  • User profile image
    dentaku

    @Bas: Just last night I was looking for Xperf to look at my DPC latency and after hunting around for a while I figured out I needed to get the Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1?

    I just wanted a simple little tool. I haven't messed with it yet but I'm going to install it on a test system and see if there's some kind of custom install I can do.

  • User profile image
    BaTTyKoda

    And it gets even better!
    I had the exact same experience as above finding and installing FxCop on my development machine...
    BUT WAIT!  THERE'S MORE!
    I also had to install FxCop 10 on a build machine.  I copied the FxCop installer from my machine to the build machine, installed FxCop and ran FxCop.  I got the runtime error stating the "Microsoft.VisualStudio.CodeAnalysis.Interop.dll" could not be found like @reidca posted above. 
    Ok, no sweat I thought, I'll just copy over the installer and run that.  No dice... it's a web installer and the build server doesn't have internet access.  Back to Google, search Windows 7 SDK Download.  I could not find a download for the SDK setup.  Just the web installer and the ISO DVD image.
    Downloaded the ISO file... back to Google to find an ISO image reader... Found one.  Downloaded it.  Ran it.  Copied the files off of the virtual CD over to the build machine.  Ran the MSI file under the WinSDKNetFxTools folder, re-installed FxCop from the installer the installer installed and repaired FxCop.  Still got the dll error.  Apparently I didn't have .NET 4.0 installed.
    Reluctantly ran the SDK Setup, installed .NET 4.0, re-installed FxCop... long story... much wailing and gnashing of teeth... uninstall SDK, re-install SDK... now it FINALLY works.
    This should NOT be so difficult.  Do I understand FxCop being bundled with the SDK?  Sure I do.  Do I understand not having a separate download for the individual components that are contained in the SDK? Not by any stretch of the imagination.  Especially considering what is necessary to find it in the first place.

  • User profile image
    Andrew_​Morton

    If anyone wants FxCop 1.36 and no .NET 4.0 framework installation, you can get it in a similar manner to Bas from
    Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1

  • User profile image
    jcnovoa

    Here is the ticket!... extract it from the CAB inside the ISO
    http://blogx.co.uk/Comments.asp?Entry=812 

  • User profile image
    ManipUni

    Microsoft should sell FxCop for $1 just so we can easily find it. I'd pay $1 for a direct download link!

  • User profile image
    intelman

    Finding the latest version of the Microsoft installer SDK to download was a pain as well. At least at one point. Pretty lame.

  • User profile image
    Grab

    Looks like Blowdart got nowhere.  The SDK is still nearly impossible to find, picking the right subset of the SDK to install is still a matter of guesswork, and installing FxCop is still an extra install after the SDK install is done.  Anyone would think they didn't want you to use .NET! *GRR*

  • User profile image
    vesuvius

    FxCop is now a part of Visual Studio 2010 Premium and Ultimate, consequently making it difficult to install on any other version.

     In Visuat Studio 2010 if you have the versions listed above it is called Code Analysis, there is a tab for it if you double click on the properties node in Solution Explorer.

  • User profile image
    vesuvius

    @Bas:By the way if you want the latest version then install the Win 7 and .NET 4.0 SDK http://blogs.msdn.com/b/codeanalysis/archive/2010/07/26/fxcop-10-0-is-available.aspx?wa=wsignin1.0

  • User profile image
    Ruthlessly​Helpful

    I have a blog post that describes how to get the FxCop 10.0 setup from the Win 7 and .NET 4.0 SDK. With the FxCopSetup.exe file, you can run the installer on a build server:
     
    Hope this helps.

  • User profile image
    ActivePlanet

    I am so happy I found this blog. It was driving me nuts! I must have uninstalled and re-installed the SDK 3 times thinking I was doing something wrong. Turns out I am not the idiot after all...

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.