Showing posts with label GAC. Show all posts
Showing posts with label GAC. Show all posts

Monday, 29 June 2009

How to copy dll from GAC

Well windows Global Assembly Cache(GAC) is a directory and it's not so. You can add file just dragging and dropping it in the folder or using Gacutil( preferred way :) ).
But what about copying back a dll from GAC? I tried to just copy it from windows explorer, but it didn't work. Context menu does not shows copy/pest. And obviously Ctrl+c Ctrl+v does not work. But as I said it's a directory you can copy it some way.
Simply use command prompt. From your windows command window change directory to C:\WINDOWS\assembly
When you run 'dir' command on this directory you will see following sub directories:
GAC
GAC_32
GAC_MSIL
NativeImages1_v1.1.4322
NativeImages_v2.0.50727_32

Go to your target directory, you can derived this information from 'Processor Architecture' columns information in windows explorer(C:\WINDOWS\Assembly). So for managed code it will be MSIL and your target directory is GAC_MSIL.

You are almost there, again 'dir' will display list of directory named after all the dlls. Change into intended directory and you will see directories with version number and your dll is inside that directory.

Enjoy reverse engineering.


Thursday, 23 October 2008

Don't mess with GAC

I was doing some work with BizTalk and BAM. As you know after every change; you need to deploy/GAC every assembly(dll) used in a BizTalk project. I was doing the same until out of refactoring I renamed couple of library while keeping others intact. 

Apparently it should not cause any problem. Just redeploy them!!

But it didn't work. The error message was quite clear, one of the dll ( name unchanged) is still being referenced by some of the old library( name changed). And as they are not in the current deployment list anymore, Visual studio is not un-installing them automatically. 
What should I do. Just thought why not just drag them out of the GAC. So simple.!!

Now as the related BizTalk application still referring old assemblies, it can't delete the application, because it can't find required dlls in GAC.

How to fix it now???!!

Why not just dive into BizTalk database and delete those application configuration information. Did that !!! So stupid!!!

I'm not a guru of BizTalk internal database obvious reason i messed up the database. And you know what I had to reinstall the whole dam BizTalk[ my dev machine only :) ] again. Amy be I could have only reconfigure it. But that thought never cam in my mind in the first place. 

So the moral of the story is, don't play around with assemblies in GAC use proper tools to do the job.  :)