Building from the Command Line (Visual Basic)
A Visual Basic project is made up of one or more separate source files. During the process known as compilation, these files are brought together into one package—a single executable file that can be run as an application.
Visual Basic provides a command-line compiler as an alternative to compiling programs from within the Visual Studio integrated development environment (IDE). The command-line compiler is designed for situations in which you do not require the full set of features in the IDE—for example, when you are using or writing for computers with limited system memory or storage space.
When compiling from the command line, you must explicitly reference the Microsoft Visual Basic run-time library through the /reference compiler option.
To compile source files from within the Visual Studio IDE, choose the Build command from the Build menu.
Tip
When you build project files by using the Visual Studio IDE, you can display information about the associated vbc command and its switches in the output window. To display this information, open the Build and Run, Projects and Solutions, Options Dialog Box, and then set the MSBuild project build output verbosity to Normal or a higher level of verbosity. For more information, see How to: View, Save, and Configure Build Log Files.
You can compile project (.vbproj) files at a command prompt by using MSBuild. For more information, see MSBuild Command-Line Reference and Walkthrough: Using MSBuild.
In This Section
How to: Invoke the Command-Line Compiler (Visual Basic)
Describes how to invoke the command-line compiler at the MS-DOS prompt or from a specific subdirectory.Sample Compilation Command Lines (Visual Basic)
Provides a list of sample command lines that you can modify for your own use.
Related Sections
Visual Basic Command-Line Compiler
Provides lists of compiler options, organized alphabetically or by purpose.Conditional Compilation in Visual Basic
Describes how to compile particular sections of code.Building and Cleaning Projects and Solutions in Visual Studio
Describes how to organize what will be included in different builds, choose project properties, and ensure that projects build in the correct order.