Compare Global Assembly Cache across Servers

When deploying .Net applications/.wsp code you will sometime have to deploy your assemblies (that needs to be GAC’ed) to multiple machines. Inevitability, you will run into the situation where the assemblies of the two machines will get out of sync. It can be a real headache to try to figure out the difference in the dlls deployed especially if you are not versioning your dlls. Recently I came across this situation and found a nice solution in form of Global Assembly Cache comparison tool. This is a nice tool which lets quickly check compare GAC across multiple servers and export results into a nice format for us.

It is to be noted that this tool does not make any changes to GAC and yes, you need to be an administrator on all servers, you want to run comparison against.

To start with this tool, first quickly download the zip from above link and then unzip it. After this run GACCompare3.exe file. Now fill in the server names and then click compare. It should show the nice output like below:

Output of GAC Comparison tool
Output of GAC Comparison tool

An X would indicate the presence of the dll on a server while white space represents its absence. It also lists some useful properties such as version no, size, location. It also allows to filter results using dll name or part of the dll name.

Now do a ctrl+A to select all output and then right click and then select ‘highlight similiar’ and then again select ‘highlight differences’. This will make for a more visually appealing difference like this:

Highilghting similiar and different Dlls

You may have noticed that when right click the output, you also get choices for exporting results in two formats: xml and html, both of which are cross platform. This allows easily be able to share results with someone else.

Also you can select to export or make a copy of the selected assemblies to a local directory on the server. for this right click the output and select option as ‘Export assemblyset to’. When exported, it separates each dll into its own server and dll folder. Directory structure is created as servername->GAC location name-> dll name -> Version name -> dll.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s