1.6. Build Projects from the Command Line Using MSBuild.exe

Problem

You need to compile one or more VB .NET files from the command line, and you need to have more precise control over the build process.

Solution

Create a project file, and use the MSBuild.exe utility that ships with Visual Studio 2008. The build project should reference each VB .NET file and compile them using the VB .NET compiler (vbc.exe) via the vbc task.

How It Works

MSBuild.exe is a utility that ships with Visual Studio. It is located in the directory specific to the target framework, such as C:\Windows\Microsoft.NET\Framework\v3.5\. This utility uses an XML project file to perform specified actions on specified files. If you build an application in Visual Studio, a file ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.