1
votes

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). Everything works fine. All this is done in Windows 7.

Now, I use the same dll on Windows XP which has .net Framework 4.0. I add the dll into the GAC on Windows XP. But I am unable to locate the dll in VB to add it as reference. 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

Any idea what I am missing here, please ?

EDIT: I have also registered the assembly with regasm utility. Any changes in the registry I should do to see my COM dll in 'available reference' list in my VB6 project??

1
You never mentioned registering the assembly with Regasm.exe. That can be automatic on your dev machine with the "Register for COM interop" checkbox, just building the project is enough. Not on that XP machine. Be sure to use the correct one, you need the old one since you are targeted an ancient .NET framework version. Do keep in mind that VB6 could not care less.Hans Passant

1 Answers

-2
votes

When registering your assembly for COM you need to call

regasm myassembly.dll /codebase

The /codebase adds the relevant Registry entries that you VB6 application will use to find the DLL.