NAnt SDK Documentation - v0.92 |

# TlbImpTask Class

Imports a type library to a .NET assembly (wraps Microsoft's `tlbimp.exe`).

For a list of all members of this type, see TlbImpTask Members.

System.Object
NAnt.Core.Element
NAnt.Core.Task
NAnt.Core.Tasks.ExternalProgramBase
NAnt.Win32.Tasks.TlbImpTask

[Visual Basic]
<TaskName(Name:="tlbimp"), _ ProgramLocation(LocationType:=LocationType.FrameworkSdkDir)>
Public Class TlbImpTask
Inherits ExternalProgramBase
[C#]
[TaskName(Name="tlbimp")]
[ProgramLocation(LocationType=LocationType.FrameworkSdkDir)]
public class TlbImpTask : ExternalProgramBase

#### Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

#### Remarks

This task lets you easily create interop assemblies. By default, it will not reimport if the underlying COM TypeLib or reference has not changed.

See the Microsoft.NET Framework SDK documentation for details.

#### Example

Import `LegacyCOM.dll` to `DotNetAssembly.dll`.

    <tlbimp typelib="LegacyCOM.dll" output="DotNetAssembly.dll" />

Generate an assembly named "Interop.MSVidCtlLib.dll" for the MS Video Control 1.0 Type Library, transforming any [out, retval] parameters of methods on dispinterfaces in the type library into return values in the managed library.

    <tlbimp typelib="msvidctl.dll" output="Interop.MSVidCtlLib.dll" transform="dispret">
        <references basedir="Interop">
            <include name="Interop.TunerLib.dll" />
        </references>
    </tlbimp>

#### Requirements

Namespace: NAnt.Win32.Tasks

Assembly: NAnt.Win32Tasks (in NAnt.Win32Tasks.dll)

#### See Also

TlbImpTask Members | NAnt.Win32.Tasks Namespace