从GAC卸载带有ProcessorArchitecture x86的程序集 [英] Uninstallation of Assemblies with ProcessorArchitecture x86 from GAC

查看:68
本文介绍了从GAC卸载带有ProcessorArchitecture x86的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在开发一个exe来从GAC卸载特定于产品的程序集.我在c#中的程序中使用了以下代码:

Assembly.LoadWithPartialName("DepconReportWizard");

DepconReportWizard是一个具有ProcessorArchitecture x86的程序集.还有其他x86程序集尚未卸载.
当我调试程序时,它会在上面提到的代码段中引发异常:
System.IO.FileNotfound异常:< pre lang ="C ++"> {& quot;找不到指定的模块. (来自HRESULT的异常:0x8007007E)& quot:null}
但是该程序集确实存在于GAC中.我能够删除所有MSIL程序集,但GAC_32文件夹或x86程序集中的程序集除外.
我也尝试过以下行

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

但找不到文件本身.无论操作系统和系统类型(32位还是64位),这在evry机器中都是相同的.
您能帮我解决这个问题的方法吗,还是可以告诉我使用这些方法的方式有误.

问候
XXXX

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

推荐答案

要使用的CMD为

gacutil.exe -U``程序集名称''

gac文件夹的pop目录内容.
System.IO.Directory.GetDirectories("GACFolder");

检查要删除的文件,然后执行

System.Diagnostics.Process.Start("gacutil.exe","-U" + _sFileName);
或类似的东西:p
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


这篇关于从GAC卸载带有ProcessorArchitecture x86的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆