# <comregister>

Register COM servers or type libraries.

COM register task will try and register any type of COM related file that needs registering.

Executable files (.exe) will be registered as exe servers, type libaries (.tlb) registered with RegisterTypeLib and for all other filetypes it will attempt to register them as dll servers.

### Parameters

Attribute | Type | Description | Required
--- | --- | --- | ---
file | file | The name of the file to register. This is provided as an alternate to using the task's fileset. | False
unregister | bool | Unregistering this time. ( /u paramater )Default is "false". | False
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False
unless | bool | Opposite of `if`. If false then the task will be executed; otherwise, skipped. The default is false. | False
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False

### Nested Elements:

#### <fileset>

The set of files to register.

#### </fileset>

### Examples

- Register a single dll server.

      <comregister file="myComServer.dll" />

- Register a single exe server

      <comregister file="myComServer.exe" />

- Register a set of COM files at once.

      <comregister unregister="false">
          <fileset>
              <include name="an_ExeServer.exe" />
              <include name="a_TypeLibrary.tlb" />
              <include name="a_DllServer.dll" />
              <include name="an_OcxServer.ocx" />
          </fileset>
      </comregister>

### Requirements

Assembly: NAnt.Contrib.Tasks (0.85.2479.0)