Visual Basic Language Concepts  

Sample Compilation Command Lines

As an alternative to compiling Visual Basic .NET programs from within Visual Studio .NET, you can compile from the command line to produce executable (.exe) files or dynamic-link library (.dll) files.

The Visual Basic .NET command-line compiler supports a complete set of options that control input and output files, assemblies, and debug and preprocessor options. Each option is available in two interchangeable forms: -option and /option. This documentation shows only the /option form.

The following table lists some sample command lines you can modify for your own use.

To Use
Compile File.vb and create File.exe vbc File.vb
Compile File.vb and create File.dll vbc /target:library File.vb
Compile File.vb and create My.exe vbc /out:My.exe File.vb
Compile all Visual Basic files in the current directory, with optimizations on and the DEBUG symbol defined, producing File2.exe vbc /define:DEBUG=1 /optimize /out:File2.exe *.vb
Compile all Visual Basic files in the current directory, producing a debug version of File2.dll without displaying the logo or warnings vbc /target:library /out:File2.dll /warn:0 /nologo /debug *.vb
Compile all Visual Basic files in the current directory to Something.dll vbc /target:library /out:Something.dll *.vb

See Also

Visual Basic Compiler Options | Conditional Compilation Overview