Friday, March 21, 2008

.NET Assembly uninstall problem

Have you ever encountered this error when you try to uninstall a .NET assembly?
Unable to uninstall: assembly is required by one or more applications Pending references:
Most probably yes!

Cause:
It is because that assembly is installed by an installer (anyone.. including standard .net MSI) . Installer specifies a traced reference count on the assembly being installed so when you try to delete assembly using GACUTIL, you get above error. I couldn’t uninstall some assembly while I was manually uninstalling a software.

Work Around:
Method 1:
Use GACBrowser software to remove such assembly (uses 3rd approach specified below). It’s Easy, search and select assembly to remove. And removed!!
Download from here:
http://sourceforge.net/project/showfiles.php?group_id=214315
GAC Browser is powerful tool to search and remove assembly. It is must have tool for any developer dealing with assemblies. On an average, if you have visual studio 2005 installed on your PC, you may see more than 1000 assemblies on you PC. There is no good way of searching assembly in you GAC unless you have GAC Browser with you. Also visibility in GAC is increased with more info like when it was last GACed. Double click any assembly to de-assemble the assembly in ILDASM. All in one! That’s why I said it a “must have”!
Method 2:
Windows maintains trace reference count in registry at two places.
[HKCU\Software\Microsoft\Installer\Assemblies\Global]
[HKLM\SOFTWARE\Classes\Installer\Assemblies\Global]
So you may want to go to this registry and remove the entry of the assembly that you want to uninstall. Use GACUTIL to remove assembly from GAC.
Method 3:
Go to Assembly folder using command prompt.1. Open CMD2. Go to assembly directory (for most of us: C:\Windows\assembly), If you type ‘DIR’, you may find different folders (important are: GAC, GAC_MSIL, GAC_32)3. Search your assembly folder from this folder, go to appropriate version folder and remove the folder.

Conclusion:
You may want to have GAC Browser software as well has use method 2 for clean operation. GAC browser is soon coming up with in build method 2.

Thursday, March 13, 2008

GAC Browser 0.9 (beta 02) released

After era of Alpha and Beta 01, we have now beta 02 ready to be downloaded. You may still find registry entries unchanged for trace referenced assemblies. It’s not at all harmful but next tidy release may handle it.

What’s new with Beta 02? It is only one thing. No double click! Based on some feedback stating unintended double clicks showing pop-up to de-assemble it. You have right click and select ‘Open with ILDASM’ option. Also, this approach will help adding more option here in future.

Last but not least, you are advised to uninstall the older software first and then install this (other wise you will see two entries at ‘Add Remove Program’), again, no harm in that but tidiness is the issue. This is because I published the software under different key (I know I did a stupidity… forgive me)

GAC Browser – An Introduction

Audience: Microsoft .NET Developer, Support people of huge .NET softwares

Problem: When you are dealing (installation, un-installation, development or support) with huge software with multiple assemblies installed in Global Assembly Cache (GAC), you will have a glance of “hell” while searching the assemblies through in-build assembly viewer on windows explorer. You will be introduced to full feature hell when you get into problem of uninstalling a traced referenced assembly which is not directly possible by popular ‘gacutil’ command. And, you will be deep into hell on occasion of accidental removal of an assembly without any backup. Surprisingly, Microsoft doesn’t seem to care about these features even when the world is in verge of hailing 3rd major release of .NET

Scope of the software: I felt a need of software to ease/eliminate above problem. Objective and vision of the software is to deal with GACed assembly completely for GAC search, software un-installation, development and support purpose.

Features: GAC Browser is powerful tool to search and remove assembly. It is must have tool for anyone dealing with assemblies in GAC. On an average, if you have visual studio 2005 installed on your PC, you may see more than 1000 assemblies on you PC. There is no good way of searching assembly in you GAC unless you have GAC Browser with you. Also, visibility in GAC is increased with more info like when it was last GACed. Double click any assembly to de-assemble the assembly in ILDASM. All in one! That’s why I said it a “must have”!

At the time, when this is written, GAC Browser supports,

· View All Assemblies form GAC.
· Search assemblies based from part of assembly name or public key.
· Sort the searched list based on any assembly attribute.
· Select one or more assemblies and remove them. Application can remove assemblies which is installed by any installer.
· Refresh your search.
· Think about suffering that you may bear to open an assembly of GAC with ILDASM. It's all easy here! Right Click and select 'Open with ILDASM' to open the assembly in IL Disassembler (ildasm), an inbuilt tool that comes with .NET.


Se See picture given below to know where to clik..Note that you have to set proper $path environment variable so that "ildasm" can work.

How to get it? You can download and install MSI for x86 CPU architecture, which also runs on x64 or AMD64, from here: http://sourceforge.net/project/showfiles.php?group_id=214315