With the release of the .NET Framework Software Development Kit (SDK), Visual Basic for the first time features a command-line compiler that allows you to create and compile Visual Basic components and applications apart from Visual Studio. Ironically, this means that one of VB.NET’s significant advances is the ability to use your favorite text editor, such as NotePad or WinEdit, to create VB.NET code. This appendix details the operation of the compiler, vbc.exe.
Syntactically, the compiler is fairly typical in that it uses command-line switches to control its operation. A command-line switch is designated by a slash or hyphen followed by a keyword. If the keyword takes an argument, it is separated from the keyword by a colon (:). For example:
vbc sample1.vb /target:library
library keyword as an argument to
create a library file (that is, a DLL). If multiple arguments are
required, they are separated from one another by commas. For example:
vbc sample1.vb /r:system.design.dll,system.messaging.dll
references the metadata in the system.design.dll and system.messaging.dll assemblies.
The minimal syntax required to compile a file named sample1.vb is:
This generates a console-mode application. You can specify the type
of component or application you wish to generate by using the
/target switch. To generate a Windows executable,
you’d enter something like the following at the
vbc sample1.vb ...