Take the 2-minute tour ×

We are supporting an aging VB6 system that we have written new code for in .Net, put the code into assemblies and then exported *.tlb files for use with the VB6 codebase.

My question is, on every computer I wish to run the code on, do I have to use Regasm to register the type libraries?

I ask because it gets difficult to keep track of type library installations as computers break, new computers get added etc. Also, if we update the .Net code, we need to go around every computer and re-register the type library.

To sum up, is it possible to run .Net code from VB6 without having to register the type library on each computer the code is running on?


share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

Regasm.exe doesn't register a type library, it only creates one when you use its /tlb command line option. Which you then use in a VB6 project with Project + References, Browse button to pick the .tlb file.

Having it appear in the VB6 list is a small convenience but that is hard to get. The standard .NET registration code called by Regasm.exe doesn't write the required keys. You have to write a custom registration function decorated by the [ComRegisterFunction] attribute that writes the missing keys. It isn't worth it.

Also note that you do not have to register the type library on the user's machine. It is only needed by the compiler. You do have to register the [ComVisible] classes, it is easy with a Setup project. Just set the Register property of the DLL to vsdrpCOM.

share|improve this answer
add comment

Your Answer


