Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

How to use FSnap to locate files with a specific version in the GAC

How to use FSnap to locate files with a specific version in the GAC

  • Comments 7

The following steps can be used to gather a list of all files installed in the Global Assembly Cache (GAC) on your system and then remove files that have been orphaned during the uninstall process for Visual Studio 2005 beta products:

  1. Download the FSnap tool and extract it to c:\fsnap.exe on your machine
  2. Click on the Start menu, choose Run, type cmd and click OK
  3. Type this command in the cmd prompt and press enter to run it:  c:\fsnap.exe /bs c:\windows\assembly\ > c:\file_list.txt

    Please note that you will need to change the paths in the steps above if you have your OS installed on a drive other than C.  Also, make sure that you include the trailing \ after the "assembly" folder name or else the FSnap tool will not work correctly. 

  4. Look at the contents of c:\file_list.txt for any files with version number 2.0.xxxxx.xx or 8.0.xxxxx.xx where the xxxxx.xx is not equal to 50727.42. 

    I have found it useful to import the contents of c:\file_list.txt into Excel and then sort alphabetically by column G (which is the file version column).  That makes it easier to zero in on files that have suspicious version information.

  5. Close Visual Studio and/or reboot the system to make sure that there will not be any files in use
  6. Remove the files that fit this criteria using gacutil.exe (which is installed to %ProgramFiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin if you have VS 2005 installed and chose to install the .NET Framework SDK tools, or can be installed by installing the .NET Framework 2.0 SDK)

If you do not have gacutil.exe or you try running it and it fails, then remove the files manually using the following steps:

  1. Click on the Start menu, choose Run and type cmd
  2. Type cd /d %windir%\assembly
  3. Type rd /s /q <full path to the directory containing the assembly with the specified version number>

<update date="12/9/2007"> Provided more specific steps for running fsnap.exe.  It has to be run from a cmd prompt and not from the Windows Run dialog or else it will not produce an output file.  </update>

 

Page 1 of 1 (7 items)
Leave a Comment
  • Please add 2 and 4 and type the answer here:
  • Post