By default, VB Migration Partners converts VB6 DLLs into .NET DLLs that can be used from existing COM clients, including VB6 applications and ASP pages. For the .NET DLL to be consumed from COM clients you might need to take additional steps.
First and foremost, you have to generate a type library for the .NET DLL. This can be accomplished by running the RegAsm utility (part of .NET Framework SDK), which has a very simple syntax:
If the DLL is signed with a public key, you can also use the /codebase option:
RegAsm c:\netdlls\mycomponent.dll /codebase
To make a migrated .NET DLL visible and usable from a VB6 client you should consider what follows:
- If the .NET DLL isn’t signed with a public key, it is crucial that the DLL is installed in the same directory as the VB6 executable. If this isn’t the case you get a runtime error when trying to instantiate the object.
- When running the VB6 project from inside the IDE, the “current directory” is the directory where the VB6.EXE file is installed (usually c:\Program Files\Microsoft Visual Studio\VB98), therefore the .NET DLL should be copied there.
- If you have a signed DLL and use the /codebase option, then the DLL doesn’t need to be stored in the same directory as the VB6 project or the VB6.EXE file.
To make a migrated .NET DLL visible and usable from an ASP page, the DLL must be signed with a public key and must be installed using RegAsm with the /codebase option.
Notice that DLLs that are signed with a public key can be also installed in the GAC, by running the GacUtils tool (also part of .NET Framework SDK), so that they are visible to all .NET and COM clients.