<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- Documenting T:NAnt.Win32.Tasks.TlbImpTask--> <head> <meta http-equiv="Content-Language" content="en-ca" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="../style.css" /> <title><tlbimp> Task</title> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar"> <tr> <td class="NavBar-Cell"> <a href="http://nant.sourceforge.net"> <b>NAnt</b> </a> <img alt="->" src="../images/arrow.gif" /> <a href="../index.html">Help</a> <img alt="->" src="../images/arrow.gif" /> <a href="../tasks/index.html">Task Reference</a> <img alt="->" src="../images/arrow.gif" /> <tlbimp></td> <td class="NavBar-Cell" align="right"> v0.91</td> </tr> </table> <h1><tlbimp></h1> <p> Imports a type library to a .NET assembly (wraps Microsoft's <code>tlbimp.exe</code>). </p> <p> This task lets you easily create interop assemblies. By default, it will not reimport if the underlying COM TypeLib or reference has not changed. </p> <p> <a href="ms-help://MS.NETFrameworkSDK/cptools/html/cpgrftypelibraryimportertlbimpexe.htm">See the Microsoft.NET Framework SDK documentation for details.</a> </p> <h3>Parameters</h3> <div class="table"> <table> <tr> <th>Attribute</th> <th style="text-align: center;">Type</th> <th>Description</th> <th style="text-align: center;">Required</th> </tr> <tr> <td valign="top" class="required">output</td> <td style="text-align: center;">file</td> <td> Specifies the name of the output file. </td> <td style="text-align: center;">True</td> </tr> <tr> <td valign="top" class="required">typelib</td> <td style="text-align: center;">file</td> <td> Specifies the source type library that gets passed to the type library importer. </td> <td style="text-align: center;">True</td> </tr> <tr> <td valign="top">asmversion</td> <td style="text-align: center;">string</td> <td> Specifies the version number of the assembly to produce. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">delaysign</td> <td style="text-align: center;">bool</td> <td> Specifies whether the resulting assembly should be signed with a strong name using delayed signing. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">keycontainer</td> <td style="text-align: center;">string</td> <td> Specifies the key container in which the public/private key pair should be found that should be used to sign the resulting assembly with a strong name. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">keyfile</td> <td style="text-align: center;">file</td> <td> Specifies the publisher's official public/private key pair with which the resulting assembly should be signed with a strong name. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">namespace</td> <td style="text-align: center;">string</td> <td> Specifies the namespace in which to produce the assembly. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">primary</td> <td style="text-align: center;">bool</td> <td> Specifies whether a primary interop assembly should be produced for the specified type library. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">publickey</td> <td style="text-align: center;">file</td> <td> Specifies the file containing the public key to use to sign the resulting assembly. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">strictref</td> <td style="text-align: center;">bool</td> <td> Specifies whether a type library should not be imported if all references within the current assembly or the reference assemblies cannot be resolved. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">sysarray</td> <td style="text-align: center;">bool</td> <td> Specifies whether to import a COM style SafeArray as a managed <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemArrayClassTopic.asp">Array</a> class type. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">transform</td> <td style="text-align: center;">string</td> <td> Specifies how to transform the metadata [.NET 1.1 or higher]. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">unsafe</td> <td style="text-align: center;">bool</td> <td> Specifies whether interfaces should be produced without .NET Framework security checks. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">failonerror</td> <td style="text-align: center;">bool</td> <td> Determines if task failure stops the build, or is just reported. The default is <b>true</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">if</td> <td style="text-align: center;">bool</td> <td> If <b>true</b> then the task will be executed; otherwise, skipped. The default is <b>true</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">timeout</td> <td style="text-align: center;">int</td> <td> The maximum amount of time the application is allowed to execute, expressed in milliseconds. Defaults to no time-out. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">unless</td> <td style="text-align: center;">bool</td> <td> Opposite of <code>if</code>. If <b>false</b> then the task will be executed; otherwise, skipped. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">verbose</td> <td style="text-align: center;">bool</td> <td> Determines whether the task should report detailed build log messages. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> </table> </div> <h3>Framework-configurable parameters</h3> <div class="table"> <table> <tr> <th>Attribute</th> <th style="text-align: center;">Type</th> <th>Description</th> <th style="text-align: center;">Required</th> </tr> <tr> <td valign="top">exename</td> <td style="text-align: center;">string</td> <td> The name of the executable that should be used to launch the external program. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">managed</td> <td style="text-align: center;"> <a href="../enums/NAnt.Core.Types.ManagedExecution.html">ManagedExecution</a> </td> <td> Specifies whether the external program should be treated as a managed application, possibly forcing it to be executed under the currently targeted version of the CLR. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">supportstransform</td> <td style="text-align: center;">bool</td> <td> Indicates whether <code>tlbimp</code> supports transforming metadata for a given target framework. The default is <b>true</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">useruntimeengine</td> <td style="text-align: center;">bool</td> <td> <i>Deprecated.</i> Specifies whether the external program is a managed application which should be executed using a runtime engine, if configured. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> </table> </div> <h3>Nested Elements:</h3> <!--Element--> <h4> <a id="references"> </a> <<a href="../types/assemblyfileset.html">references</a>> </h4> <div class="nested-element"> Specifies the assembly files to use to resolve references to types defined outside the current type library. <p /></div> <h4> <a id="references"> </a> </<a href="../types/assemblyfileset.html">references</a>> </h4> <!--Array--> <!--NestedElementArray=T:NAnt.Core.Types.Argument--> <h4> <a id="arg"> </a> <arg> </h4> <div class="nested-element"> The command-line arguments for the external program. <p> Represents a command-line argument. </p><p> When passed to an external application, the argument will be quoted when appropriate. This does not apply to the <code>line</code> parameter, which is always passed as is. </p><h3>Parameters</h3><div class="table"><table><tr><th>Attribute</th><th style="text-align: center;">Type</th><th>Description</th><th style="text-align: center;">Required</th></tr><tr><td valign="top">dir</td><td style="text-align: center;">directory</td><td> The value for a directory-based command-line argument; will be replaced with the absolute path of the directory. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">file</td><td style="text-align: center;">file</td><td> The name of a file as a single command-line argument; will be replaced with the absolute filename of the file. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">if</td><td style="text-align: center;">bool</td><td> Indicates if the argument should be passed to the external program. If <b>true</b> then the argument will be passed; otherwise, skipped. The default is <b>true</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">line</td><td style="text-align: center;">string</td><td> List of command-line arguments; will be passed to the executable as is. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">path</td><td style="text-align: center;"><path></td><td> The value for a PATH-like command-line argument; you can use <code>:</code> or <code>;</code> as path separators and NAnt will convert it to the platform's local conventions, while resolving references to environment variables. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">unless</td><td style="text-align: center;">bool</td><td> Indicates if the argument should not be passed to the external program. If <b>false</b> then the argument will be passed; otherwise, skipped. The default is <b>false</b>. </td><td style="text-align: center;">False</td></tr><tr><td valign="top">value</td><td style="text-align: center;">string</td><td> A single command-line argument; can contain space characters. </td><td style="text-align: center;">False</td></tr></table></div><h3>Nested Elements:</h3><!--Element--><h4><a id="path"></a> <<a href="../types/path.html">path</a>> </h4><div class="nested-element"> Sets a single command-line argument and treats it like a PATH - ensures the right separator for the local platform is used. <p /></div><h4><a id="path"></a> </<a href="../types/path.html">path</a>> </h4><h3>Examples</h3><ul class="examples"><li><p> A single command-line argument containing a space character. </p><pre class="code"> <arg value="-l -a" /> </pre></li><li><p> Two separate command-line arguments. </p><pre class="code"> <arg line="-l -a" /> </pre></li><li><p> A single command-line argument with the value <code>\dir;\dir2;\dir3</code> on DOS-based systems and <code>/dir:/dir2:/dir3</code> on Unix-like systems. </p><pre class="code"> <arg path="/dir;/dir2:\dir3" /> </pre></li></ul></div> <h4> <a id="arg"> </a> </arg> </h4> <h3>Examples</h3> <ul class="examples"> <li> <p>Import <code>LegacyCOM.dll</code> to <code>DotNetAssembly.dll</code>.</p> <pre class="code"> <tlbimp typelib="LegacyCOM.dll" output="DotNetAssembly.dll" /> </pre> </li> <li> <p> 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. </p> <pre class="code"> <tlbimp typelib="msvidctl.dll" output="Interop.MSVidCtlLib.dll" transform="dispret"> <references basedir="Interop"> <include name="Interop.TunerLib.dll" /> </references> </tlbimp> </pre> </li> </ul> <h3>Requirements</h3> <div style="margin-left: 20px;"> <b>Assembly:</b> NAnt.Win32Tasks (0.91.4312.0) </div> </body> </html>