简体   繁体   English

VB6从Windows 7到Windows XP加载.net 4 C#COM dll

[英]VB6 Loading .net 4 C# COM dll from Windows 7 to Windows XP

I have a C# ComVisible Class Library dll created on .Net Framework 4.5 environment - but the dll target framework is set to Framework 3.5 I have created the COM dll and added it to a GAC using Visual Studio 2012 I add this dll as a reference in my legacy VB6 project ( from Project->Add Reference). 我在.Net Framework 4.5环境中创建了一个C#ComVisible类库dll,但是dll目标框架设置为Framework 3.5。我的旧版VB6项目(来自“项目”->“添加参考”)。 Everything works fine. 一切正常。 All this is done in Windows 7. 所有这些都在Windows 7中完成。

Now, I use the same dll on Windows XP which has .net Framework 4.0. 现在,我在具有.net Framework 4.0的Windows XP上使用相同的dll。 I add the dll into the GAC on Windows XP. 我将dll添加到Windows XP上的GAC中。 But I am unable to locate the dll in VB to add it as reference. 但是我无法在VB中找到将该dll添加为参考。 Could you please tell me what I might be missing. 你能告诉我我可能会想念的吗。 In my XP machine, the dll is present in: C:\\WINDOWS\\assembly\\GAC_MSIL location 在我的XP计算机中,该dll位于:C:\\ WINDOWS \\ assembly \\ GAC_MSIL位置

Any idea what I am missing here, please ? 知道我在这里缺少什么吗?

EDIT: I have also registered the assembly with regasm utility. 编辑:我也用regasm实用程序注册了该程序集。 Any changes in the registry I should do to see my COM dll in 'available reference' list in my VB6 project?? 注册表中的任何更改我都应该执行才能在VB6项目的“可用引用”列表中看到我的COM dll?

When registering your assembly for COM you need to call 为COM注册程序集时,您需要调用

regasm myassembly.dll /codebase

The /codebase adds the relevant Registry entries that you VB6 application will use to find the DLL. / codebase添加VB6应用程序将用于查找DLL的相关注册表项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM