Visual Basic Compiler Options Listed by Category

The Visual Basic command-line compiler is provided as an alternative to compiling programs from within the Visual Studio integrated development environment (IDE). The following is a list of the Visual Basic command-line compiler options sorted by functional category.

Compiler Output

Option

Purpose

/nologo

Suppresses compiler banner information.

/utf8output

Displays compiler output using UTF-8 encoding.

/verbose

Outputs extra information during compilation.

Optimization

Option

Purpose

/filealign

Specifies where to align the sections of the output file.

/optimize

Enables/disables optimizations.

Output Files

Option

Purpose

/doc

Process documentation comments to an XML file.

/netcf

Sets the compiler to target the .NET Compact Framework.

/out

Specifies an output file.

/target

Specifies the format of the output.

.NET Assemblies

Option

Purpose

/addmodule

Causes the compiler to make all type information from the specified file(s) available to the project you are currently compiling.

/delaysign

Specifies whether the assembly will be fully or partially signed.

/imports

Imports a namespace from a specified assembly.

/keycontainer

Specifies a key container name for a key pair to give an assembly a strong name.

/keyfile

Specifies a file containing a key or key pair to give an assembly a strong name.

/libpath

Specifies the location of assemblies referenced by the /reference option.

/reference

Imports metadata from an assembly.

/moduleassemblyname

Specifies the name of the assembly that a module will be a part of.

Debugging/Error Checking

Option

Purpose

/bugreport

Creates a file that contains information that makes it easy to report a bug.

/debug

Produces debugging information.

/nowarn

Suppresses the compiler's ability to generate warnings.

/quiet

Prevents the compiler from displaying code for syntax-related errors and warnings.

/removeintchecks

Disables integer overflow checking.

/warnaserror

Promotes warnings to errors.

Help

Option

Purpose

/?

Displays the compiler options. This command is the same as specifying the /help option. No compilation occurs.

/help

Displays the compiler options. This command is the same as specifying the /? option. No compilation occurs.

Language

Option

Purpose

/optionexplicit

Enforces explicit declaration of variables.

/optionstrict

Enforces strict type semantics.

/optioncompare

Specifies whether string comparisons should be binary or use locale-specific text semantics.

/optioninfer

Enables the use of local type inference in variable declarations.

Preprocessor

Option

Purpose

/define

Defines symbols for conditional compilation.

Resources

Option

Purpose

/linkresource

Creates a link to a managed resource.

/resource

Embeds a managed resource in an assembly.

/win32icon

Inserts an .ico file into the output file.

/win32resource

Inserts a Win32 resource into the output file.

Miscellaneous

Option

Purpose

@ (Specify Response File)

Specifies a response file.

/baseaddress

Specifies the base address of a DLL.

/codepage

Specifies the code page to use for all source code files in the compilation.

/errorreport

Specifies how the Visual Basic compiler should report internal compiler errors.

/main

Specifies the class that contains the SubMain procedure to use at startup.

/noconfig

Do not compile with Vbc.rsp

/nostdlib

Causes the compiler not to reference the standard libraries.

/nowin32manifest

Instructs the compiler not to embed any application manifest into the executable file.

/platform

Specifies the processor platform the compiler targets for the output file.

/recurse

Searches subdirectories for source files to compile.

/rootnamespace

Specifies a namespace for all type declarations.

/sdkpath

Specifies the location of Mscorlib.dll and Microsoft.VisualBasic.dll.

/vbruntime

Specifies that the compiler should compile without a reference to the Visual Basic Runtime Library, or with a reference to a specific runtime library.

/win32manifest

Identifies a user-defined Win32 application manifest file to be embedded into a project's portable executable (PE) file.

See Also

Concepts

Introduction to the Project Designer

Reference

Visual Basic Compiler Options Listed Alphabetically