VB Migration Partner

KNOWLEDGE BASE - General


Previous | Index | Next 

[HOWTO] Using migrated .NET DLLs from VB6, ASP, and other COM clients

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:

     RegAsm  c:\netdlls\mycomponent.dll  
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.

Previous | Index | Next 




Follow Francesco Balena on VB6 migration’s group on

LinkedIn





Read Microsoft Corp’s official case study of a VB6 conversion using VB Migration Partner.




Code Architects and its partners offers remote and onsite migration services.

More details




Subscribe to our free newsletter for useful VB6 migration tips and techniques.

newsletter



To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file. You will receive a detailed report about your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.

Get free advice



A fully-working, time-limited Trial Edition of VB Migration Partner allows you to test it against your actual code

Get the Trial




The price of VB Migration Partner depends on the size of the VB6 application, the type of license, and other factors

Request a quote




Migrating a VB6 application in 10 easy steps

Comparing VB Migration Partner with Upgrade Wizard

Migration tools: Feature Comparison Table

All whitepapers