Click here to Skip to main content
16,000,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am developing an exe to uninstall assemblies specific to a product from GAC.I have used the following code for this in my program in c#:

Assembly.LoadWithPartialName("DepconReportWizard");

DepconReportWizard is an assembly with ProcessorArchitecture x86.There are other x86 assemblies that are not getting uninstalled.
When i debug my program, it throws an exception at the piece of code mentioned above as :
System.IO.FileNotfound Exception : <pre lang="C++">{&quot;The specified module could not be found. (Exception from HRESULT: 0x8007007E)&quot;:null}
But the assembly does exist in the GAC.Im able to delete all MSIL assemblies except for assemblies that are in GAC_32 folder or x86 assemblies.
I have also tried with the below line

Assembly.Load("DepconReportWizard") and loadfile...etc,

but not able to find the file itself.This is the same in evry machine irrespective of the OS and the system type i.e a 32 bit or 64 bit.
Can you please help me out to find a solution for this, or can u tell me there is mistake in the way I use the methods.

Regards
XXXX
Posted

1 solution

The CMD to use would be

gacutil.exe -U 'assembly name'

pop Directory content of the gac folder.
System.IO.Directory.GetDirectories("GACFolder");

check the files you want to remove then execute

System.Diagnostics.Process.Start("gacutil.exe", "-U " + _sFileName);
or something like that :p
 
Share this answer
 

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