Share via

RegisterAssembly Task


This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Reads the metadata within the specified assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. The behavior of this task is similar, but not identical, to that of the Regasm.exe (Assembly Registration Tool).


The following table describes the parameters of the RegisterAssembly task.

Parameter Description
Assemblies Required ITaskItem[] parameter.

Specifies the assemblies to be registered with COM.
AssemblyListFile Optional ITaskItem parameter.

Contains information about the state between the RegisterAssembly task and the UnregisterAssembly task. This prevents the UnregisterAssembly task from attempting to unregister an assembly that failed to register in the RegisterAssembly task.
CreateCodeBase Optional Boolean parameter.

If true, creates a codebase entry in the registry, which specifies the file path for an assembly that is not installed in the global assembly cache. You should not specify this option if you will subsequently install the assembly that you are registering into the global assembly cache.
TypeLibFiles Optional ITaskItem[] output parameter.

Specifies the type library to generate from the specified assembly. The generated type library contains definitions of the accessible types defined within the assembly. The type library is only generated if one of the following is true:

- A type library of that name does not exist at that location.
- A type library exists but it is older than the assembly being passed in.

If the type library is newer than the assembly being passed, a new one will not be created, but the assembly will still be registered.

If this parameter is specified, it must have the same number of items as the Assemblies parameter or the task will fail. If no inputs are specified, the task will default to the name of the assembly and change the extension of the item to .tlb.


In addition to the parameters listed above, this task inherits parameters from the TaskExtension class, which itself inherits from the Task class. For a list of these additional parameters and their descriptions, see TaskExtension Base Class.


The following example uses the RegisterAssembly task to register the assembly specified by the MyAssemblies item collection.

<Project xmlns="">  
        <MyAssemblies Include="MyAssembly.dll" />  
    <Target Name="RegisterAssemblies">  
            Assemblies="@(MyAssemblies)" >  

See Also

Task Reference