UnregisterAssembly TaskĀ 

Unregisters the specified assemblies for COM interop purposes. Performs the reverse of the RegisterAssembly task.


The following table describes the parameters of the UnregisterAssembly task.

Parameter Description


Optional ITaskItem[] parameter.

Specifies the assemblies to be unregistered.


Optional ITaskItem parameter.

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

If this parameter is specified, the Assemblies and TypeLibFiles parameters are ignored.


Optional ITaskItem[] output parameter.

Unregisters the specified type library from the specified assembly.


This parameter is only necessary if the type library file name is different than the assembly name.


It is not required that the assembly exists for this task to be successful. If you attempt to unregister an assembly that does not exist, the task will succeed with a warning. This occurs because it is the job of this task to remove the assembly registration from the registry. If the assembly does not exist, it is not in the registry, and therefore, the task succeeded.


The following example uses the UnregisterAssembly task to unregister the assembly at the path specified by the OutputPath and FileName properties, if it exists.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="UnregisterAssemblies">
            Assemblies="$(OutputPath)$(FileName)" />


See Also


RegisterAssembly Task


MSBuild Tasks

Other Resources

MSBuild Task Reference