NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Assembly Registration Tool (RegAsm.exe)

RegAsm reads the metadata within an assembly and adds the necessary entries to the registry so classic COM clients can create the NGWS runtime classes transparently. Once a class is registered, any classic COM client can use it as though the class were a COM class. The registration process is only done one time when the assembly is installed. The classes within the assembly are not COM creatable until they are actually registered.

RegAsm can also be used to generate a .reg file with the needed entries instead of actually making the changes to the registry.

Syntax

RegAsm AssemblyFile [options] 
Option Description
/reg: RegFile Generates a .reg file named RegFile for the assembly, containing the registry entries that would have been added if this option had not been provided. The registry is not changed when this option is specified.
/u Causes RegAsm to unregister the public classes found in AssemblyFile. Omitting this option causes the public classes in the assembly to be registered.
/s Suppresses all console output.

Remarks

If the /reg option is specified and RegAsm generates a .reg file, the .reg file can be used to update the registry on a machine by importing the file with the RegEdit tool. Note, however, that the .reg file does not contain any registry updates that may be made by any user defined register functions.

Using the /tlb option has the same effect as running TlbExp then RegAsm.

Examples

This example registers all public classes contained in mytest.dll.

RegAsm mytest.dll

This example generates the file MyReg.reg that contains all the entries that would have been made to the registry if the /reg option had not been supplied. The registry is not updated.

RegAsm mytest.dll /reg: mytest.reg 

This example registers all public classes contained in mytest.dll. Generates and registers the type library mytest.tlb that contains definitions of all the public types defined in mytest.dll.

RegAsm mytest.dll /tlb: mytest.tlb

This example generates the type library mytest.tlb that contains definitions of all the public types defined in mytest.dll. It also generates the file MyReg.reg that contains all the entries that would have been made to the registry if the /reg option had not been supplied. The registry is not updated.

RegAsm mytest.dll /tlb: mytest.tlb /reg mytest.reg