我是否需要强制GAC重新加载程序集?这可能吗?这可、加载、程序、GAC

2023-09-07 09:39:49 作者:旧人揪心

我添加类型,我使用的COM互操作我的.NET类。为了得到它与我的VB6应用程序的工作,我注销了的DLL并重新注册它(使用 regasm )。然后我卸载并重新安装到GAC中(使用 GACUTIL )。

I've added types to my .NET classes that I'm using for COM interop. To get it to work with my VB6 application, I unregistered the DLL and re-registered it (using regasm). I then uninstalled and reinstalled it to the GAC (using gacutil).

类型都出现在VB6的对象资源管理器,但是当我运行在VB6 IDE中的应用程序,它打破了在该实例的新类型有错误的行:自动化Errror - 该系统找不到指定文件

The types are showing up in the VB6 object explorer, but when I run the application in the VB6 IDE, it breaks on the line that instantiates the new types with the error: Automation Errror - The System cannot find the file specified.

我觉得这很奇怪,因为我已经更新了GAC,所以我的卸载的来自海关总署的DLL,并得到了完全相同的错误,这似乎表明该dll的旧版本已经是在存储器和需要被重新加载,使得较新的DLL是在存储器中。这是可能的,如果是这样,有什么我需要做什么?

I thought this odd since I had already updated the GAC, so I uninstalled the dll from the GAC and got the exact same error, which seems to indicate that the older version of the dll is already in memory and needs to be "reloaded" so that the newer DLL is in memory. Is this possible, and if so, what do I need to do?

推荐答案

尝试保存您的VB6项目,关闭IDE并重新打开您的项目。在这种情况下,为我工作。

Try saving your VB6 project, closing the IDE and re-opening your project. That worked for me in this situation.