Building VB 2008 Applications Using vbcexe

To illustrate how to build a .NET application IDE-free, we will build a simple single-file assembly named TestApp.exe using the VB 2008 command-line compiler and Notepad. First, you need some source code. Open Notepad and enter the following:

' A simple VB 2008 application.

Imports System

Module TestApp Sub Main()

Console.WriteLine("Testing! 1, 2, 3") End Sub End Module

Once you have finished, save the file in a convenient location (e.g., C:\VbcExample) as TestApp.vb. Now, let's get to know the core options of the VB 2008 compiler. The first point of interest is to understand how to specify the name and type of assembly to create (e.g., a console application named MyShell.exe, a code library named MathLib.dll, a Windows Forms application named MyWinApp.exe, etc.). Each possibility is represented by a specific flag passed into vbc.exe as a command-line parameter (see Table 2-1).

Table 2-1

. Output-centric Options of the VB 2008 Compiler


Was this article helpful?

0 0

Post a comment