How to register a type library without RegAsm.exe

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

I am developing a build in .NET that will provide some modern features for our older VB6 applications. I successfully registered the assembly and type library on my development machine using RegAsm as follows:

regasm.exe MyAssembly.dll /tlb /codebase

The above command generates a type library (MyAssembly.tlb) and registers it, and also registers the assembly. I need a registered type library so that I can use Intellisense in VB6.

My problem with this method is that I do not have the same level of control when creating the type library file as I do, Tlbexp.exe . In particular, I need to use the TlbExp / names flag to specify the correct argument for my property names (RegAsm tricks them). So, if I use TlbExp to generate my tlb file, is there a way to register it separately from the assembly registration process?

Edit: da_m_n the answer is correct for the question I asked. However, I was mistaken in the assumption that it was only because RegAsm could register the type library that it was necessary to register tlb as a reference to it in VB6. Therefore, at the moment I am registering the assembly and referring to an unregistered TlbExp-generated tlb with fixed names.

+5
source share
2 answers

Use regtlib.exe to register tlbexp tlb file.

+4
source

regtlib.exe Win10. TlbExp.exe, .NET SDK (, "%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\TlbExp.exe" "$(TargetDir)$(TargetFileName)" . https://docs.microsoft.com/en-us/dotnet/framework/tools/tlbexp-exe-type-library-exporter).

+1

All Articles