MSBuild task to build VB6


UPDATE: 01 Feb 2010 — This task is now available in the MSBuild Extension Pack

This is not something I thought I would write, but it seems that there are still many out there who have VB6 in their code base and need to have that code built as part of their build process. There are a few ways to do this, but the easiest would be to simply call a MSBuild task. I’ve therefore added a BuildVB6 task to the FreeToDev.MSBuild.Tasks.dll. Download the update with samples from here.

Parameters

  • Projects [Required]: A collection of paths to the VB6 projects. The OutDir is optional and will default to what is set in the .vbp
  • VB6Path [Optional]: Defaults to C:\Program Files\Microsoft Visual Studio\VB98\VB6.exe

Sample

<Project DefaultTargets=”Execute” xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″>
<Import Project=”FreeToDev.MSBuildTasks.tasks”/>
<ItemGroup>
     <ProjectsToBuild Include=”C:\MyVB6Project.vbp”>
          <OutDir>c:\bob</OutDir>
     </ProjectsToBuild>
     <ProjectsToBuild Include=”C:\MyVB6Project2.vbp”/>
</ItemGroup>
<Target Name=”Execute”>
     <BuildVB6 Projects=”@(ProjectsToBuild)”/>
</Target>
</Project>

NOTE: If you have used the Detokenise task, this release introduces an updated tasks file.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s