NAnt SDK Documentation - v0.92 |

# VbcTask Class

Compiles Visual Basic.NET programs.

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

System.Object
NAnt.Core.Element
NAnt.Core.Task
NAnt.Core.Tasks.ExternalProgramBase
NAnt.DotNet.Tasks.CompilerBase
NAnt.DotNet.Tasks.VbcTask

[Visual Basic]
<ProgramLocation(LocationType:=LocationType.FrameworkDir), _ TaskName(Name:="vbc")>
Public Class VbcTask
Inherits CompilerBase
[C#]
[ProgramLocation(LocationType=LocationType.FrameworkDir)]
[TaskName(Name="vbc")]
public class VbcTask : CompilerBase

#### 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

> Note In order to have VbcTask generate manifest resource names that match those generated by Microsoft Visual Studio.NET, the value of the Prefix attribute of the <ResourcesList> element should match the "Root namespace" of the VB.NET project, and the value of the DynamicPrefix attribute should be set to "false".

#### Example

Example build file using this task.

    <project name="Hello World" default="build" basedir=".">
      <property name="basename" value="HelloWorld" />
      <target name="clean">
         <delete file="${basename}-vb.exe" failonerror="false" />
         <delete file="${basename}-vb.pdb" failonerror="false" />
      </target>
      <target name="build">
         <vbc target="exe" output="${basename}-vb.exe" rootnamespace="${basename}">
            <imports>
                <import namespace="System" />
                <import namespace="System.Data" />
            </imports>
            <sources>
               <include name="${basename}.vb" />
            </sources>
            <resources prefix="${basename}" dynamicprefix="true">
                <include name="**/*.resx" />
            </resources>
            <references>
                <include name="System.dll" />
                <include name="System.Data.dll" />
            </references>
         </vbc>
      </target>
      <target name="rebuild" depends="clean, build" />
    </project>

#### Requirements

Namespace: NAnt.DotNet.Tasks

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

#### See Also

VbcTask Members | NAnt.DotNet.Tasks Namespace