Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am having some problem in removing an assembly from the GAC. I can not use "gacutil" because it might

not be present in all system(including the machine having .NET frame work).

I am using "System.EnterpriceServices.Internal.Publish" object to add and remove assembly.

Addition of assembly is fine but I can not remove it.
I am using this code to remove..

Publish pObj = new Publish();
pObj.GacRemove("myassemblypath");

Am I missing some steps??
What should I do??
Any suggestion is welcome...
Posted

Have a look at this[^] interesting article. It might help.
 
Share this answer
 
Comments
Debojyoti Majumder 1-Feb-11 8:47am    
Thanks, It helped
Abhinav S 1-Feb-11 9:29am    
You are welcome.
to remove the assembly - use full path with the file name
pobj.GacRemove("AssemblyPath");

Moreover make sure, your assembly should be signed using:
sn.exe -k assemblyname //either it is .dll or .exe
 
Share this answer
 
Comments
Debojyoti Majumder 18-Jan-11 2:17am    
Yes, I have signed my assembly.
In my case my assembly is .dll

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900