Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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

Assemblies

Optional ITaskItem[] parameter.

Specifies the assemblies to be unregistered.

AssemblyListFile

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.

TypeLibFiles

Optional ITaskItem[] output parameter.

Unregisters the specified type library from the specified assembly.

NoteNote

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">
    <PropertyGroup>
        <OutputPath>\Output\</OutputPath>
        <FileName>MyFile.dll</FileName>
    </PropertyGroup>
    <Target Name="UnregisterAssemblies">
        <UnregisterAssembly
            Condition="Exists('$(OutputPath)$(FileName)')"
            Assemblies="$(OutputPath)$(FileName)" />
    </Target>

</Project>
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft