NAnt SDK Documentation - v0.92

AssemblyInfoTask Class

Generates an AssemblyInfo file using the attributes given.

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

System.Object
   NAnt.Core.Element
      NAnt.Core.Task
         NAnt.DotNet.Tasks.AssemblyInfoTask

[Visual Basic]
<Serializable, _  Serializable, _  TaskName(Name:="asminfo")>
Public Class AssemblyInfoTask
    Inherits Task
[C#]
[Serializable]
[Serializable]
[TaskName(Name="asminfo")]
public class AssemblyInfoTask : Task

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.

Example

Create a C# AssemblyInfo file containing the specified assembly-level attributes.

    
<asminfo output="AssemblyInfo.cs" language="CSharp">
    <imports>
        <import namespace="System" />
        <import namespace="System.Reflection" />
        <import namespace="System.EnterpriseServices" />
        <import namespace="System.Runtime.InteropServices" />
    </imports>
    <attributes>
        <attribute type="ComVisibleAttribute" value="false" />
        <attribute type="CLSCompliantAttribute" value="true" />
        <attribute type="AssemblyVersionAttribute" value="1.0.0.0" />
        <attribute type="AssemblyTitleAttribute" value="My fun assembly" />
        <attribute type="AssemblyDescriptionAttribute" value="More fun than a barrel of monkeys" />
        <attribute type="AssemblyCopyrightAttribute" value="Copyright (c) 2002, Monkeyboy, Inc." />
        <attribute type="ApplicationNameAttribute" value="FunAssembly" />
    </attributes>
    <references>
        <include name="System.EnterpriseServices.dll" />
    </references>
</asminfo>
    
  

Create a C# AssemblyInfo file containing an attribute with multiple named properties by setting the AsIs attribute on the AssemblyAttribute element to true.

    
<asminfo output="AssemblyInfo.cs" language="CSharp">
    <imports>
        <import namespace="log4net.Config" />
    </imports>
    <attributes>
        <attribute type="DOMConfiguratorAttribute" value="ConfigFile=&quot;config.log4net&quot;,Watch=true" asis="true" />
    </attributes>
    <references>
        <include name="log4net.dll" />
    </references>
</asminfo>
    
  

Requirements

Namespace: NAnt.DotNet.Tasks

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

See Also

AssemblyInfoTask Members | NAnt.DotNet.Tasks Namespace