How to Register a Type Library without RegAsm.exe

Kyle Gagnet picture Kyle Gagnet · Mar 3, 2010 · Viewed 8.9k times · Source

I want to know if it's possible to register a type library without using the RegAsm tool. Here is my situation, which will hopefully explain why I want to do this:

I'm developing an assembly in .NET that will provide some modern functionality for our older VB6 applications. I have successfully registered the assembly and the type library on my development machine using RegAsm like so:

regasm.exe MyAssembly.dll /tlb /codebase

The above command generates the type library (MyAssembly.tlb) and registers it as well as registering the assembly. I need the type library registered so that I can have Intellisense in VB6.

My problem with this method is that I don't have the same level of control when generating the type library file as I do with TlbExp.exe. In particular, I need to use TlbExp's /names flag to specify the proper case of my property names (RegAsm butchers them). So if I use TlbExp to generate my tlb file, is there any way that I can register it separately from the assembly registration process?

Edit: da_m_n's answer is correct for the question I asked. However, I was under the faulty assumption that just because RegAsm could register a type library that it was necessary to register the tlb in order reference it in VB6. So for now I'm registering the assembly and referencing the unregistered, TlbExp-generated tlb with the fixed names.

Answer

da_m_n picture da_m_n · Mar 3, 2010

Use regtlib.exe to register the tlbexp generated tlb file.