The type library importer is responsible for converting the type definitions found within a COM type library into equivalent definition in NGWS runtime metadata format. Conversions are done for an entire type library at one time. You cannot use TlbImp to generate type information for a subset of the types defined within a single type library. The output of TlbImp is a binary file that contains NGWS runtime metadata for the types defined within the original type library. You can examine this file with tools such as Ildasm.exe.
TlbImp TlbFile [/out: file] [/originator: file] [/keyfile: file][/keycontainer: name] [/unsafe] [/silent]
Option | Description |
---|---|
/out: file | Specifies the name of the output file that the metadata definitions will be written to. If the option is omitted, the metadata is written to a file with the same name as the type library (not the file but the actual library name within the file) defined within the input file with the .dll extension. If the output file is the same name as the input file and error is generated to prevent overwriting the type library. |
/originator: file | Uses the originator key found in file to identity the resulting assembly. The originator key is generated from the public/private key pair supplied with the /keyfile or /keycontainer options if this option is not supplied. This allows an alternate originator key to be supplied to support developer key pair scenarios. The file is in the format generated by SN, a utility also available with the NGWS SDK. |
/keyfile: file | Signs the resulting assembly with a strong name using the public/private key pair found in file. The key file should be in the formatted generated by the SN utility. |
/keycontainer: name | Signs the resulting assembly with a strong name using the public/private key pair found in the key container specified by name. |
/unsafe | Produces interfaces without runtime security checks. |
/nologo | Prevents TlbImp from displaying a logo. |
/silent | Prevents TlbImp from displaying a success message. |
/verbose | Displays extra information. |
/? or /help | Displays help for the tool. |
The /keyfile and /keycontainer options both allow assemblies to be strongly named. It only makes sense to supply one of them at a time.
The following example generates a metadata DLL with the same name as the type library found in mytest.dll and with the .dll extension.
TlbImp mytest.tlb
The following example generates an NGWS runtime metadata DLL with the name Mytest.dll.
TlbImp mytest.tlb /out: Mytest.dll
A resource ID can optionally be appended to the TlbFile when importing a type library from a module containing multiple type libraries.
TlbImp MyModule.dll\1
Generating NGWS Runtime Metadata | Exposing Unmanaged COM objects to the NGWS Runtime