How to Remove a Custom Component from the Global Assembly (GAC)

How to Remove a Custom Component from the Global Assembly (GAC)

Okay, so you might be laughing right now, as this seems simple and straight forward–and it is, really, once you know how to do it. But for the life of me, I could not find a single resource online to walk me through removing old custom functoids from the GAC. I have been rebuilding functoids that other developers have created, in order to add functionality. For example, the Improved Context Accessor functoid. (Also, my co-worker and I are developing a SQL executor functoid, so stay tuned) Over the course of development, I have added, removed, added, removed countless .dlls from the GAC.

Enter the difficulty. As most people know, you can GAC a .dll for a custom functoid by saving the .dll to C:\Program Files (86)\Microsoft BizTalk Server 2010\Developer Tools\Mapper Extensions, opening the Visual Studio Command Prompt, and using the command

gacutil -i "C:\Program Files (86)\Microsoft BizTalk Server 2010\Developer Tools\Mapper Extensions\functoidname.dll"

And to remove the  custom functoid, the code should be:

gacutil -u "functoidname.dll"

Or, so I thought. But this does not actually work, as the Visual Studio Command prompt will not be able to find that .dll. Most sites told me to look in the C:\Windows\assembly folder for a list of all the deployed assemblies. However, none of my functoids were there.

Solution

After more looking, I found that .Net Framework 4 applications deploy to a different location: C:\Windows\Microsoft.NET\assembly\GAC_MSIL If you look in that folder, you will see a list of all your custom functoids. Now, how do we uninstall one? You cannot right click on it and uninstall as you can in C:\Windows\assembly. You still have to use the Visual Studio Command prompt. Take the same of the folder your .dll is stored in, and perform the same code as above. This is what mine looked like:

gacutil -u "BizTalk.MapperExtensions.functoidname"

Notice, I am not using “functoidname.dll”, but “BizTalk.MapperExtensions.functoidname”, as that is how it appears int he GAC_MSIL folder. And that’s it! You will no longer see that tool in the assembly.

Note: If you have an updated functoid with the same name as one that is already deployed to the GAC, you will not need to un-deploy the old one before deploying the new one. The new will overwrite the old.

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s