Visual Basic compiler options listed alphabetically

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

Every compiler option is available in two forms: -option and /option. The documentation only shows the -option form.

Option Purpose
@ (Specify Response File) Specifies a response file.
-? Displays compiler options. This command is the same as specifying the -help option. No compilation occurs.
-additionalfile Names additional files that don't directly affect code generation but may be used by analyzers for producing errors or warnings.
-addmodule Causes the compiler to make all type information from the specified file(s) available to the project you are currently compiling.
-analyzer Run the analyzers from this assembly (Short form: -a)
-baseaddress Specifies the base address of a DLL.
-bugreport Creates a file that contains information that makes it easy to report a bug.
-checksumalgorithm:<alg> Specify the algorithm for calculating the source file checksum stored in PDB. Supported values are: SHA1 (default) or SHA256.
Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
-codepage Specifies the code page to use for all source code files in the compilation.
-debug Produces debugging information.
-define Defines symbols for conditional compilation.
-delaysign Specifies whether the assembly will be fully or partially signed.
-deterministic Causes the compiler to output an assembly whose binary content is identical across compilations if inputs are identical.
-doc Processes documentation comments to an XML file.
-errorreport Specifies how the Visual Basic compiler should report internal compiler errors.
-filealign Specifies where to align the sections of the output file.
-help Displays compiler options. This command is the same as specifying the -? option. No compilation occurs.
-highentropyva Indicates whether a particular executable supports high entropy Address Space Layout Randomization (ASLR).
-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 that contains a key or key pair to give an assembly a strong name.
-langversion Specify language version: 9|9.0|10|10.0|11|11.0.
-libpath Specifies the location of assemblies referenced by the -reference option.
-linkresource Creates a link to a managed resource.
-main Specifies the class that contains the Sub Main procedure to use at startup.
-moduleassemblyname Specifies the name of the assembly that a module will be a part of.
-modulename:<string> Specify the name of the source module
-netcf Sets the compiler to target the .NET Compact Framework.
-noconfig Do not compile with Vbc.rsp.
-nologo Suppresses compiler banner information.
-nostdlib Causes the compiler not to reference the standard libraries.
-nowarn Suppresses the compiler's ability to generate warnings.
-nowin32manifest Instructs the compiler not to embed any application manifest into the executable file.
-optimize Enables/disables code optimization.
-optioncompare Specifies whether string comparisons should be binary or use locale-specific text semantics.
-optionexplicit Enforces explicit declaration of variables.
-optioninfer Enables the use of local type inference in variable declarations.
-optionstrict Enforces strict language semantics.
-out Specifies an output file.
-parallel[+|-] Specifies whether to use concurrent build (+).
-platform Specifies the processor platform the compiler targets for the output file.
-preferreduilang Specify the preferred output language name.
-quiet Prevents the compiler from displaying code for syntax-related errors and warnings.
-recurse Searches subdirectories for source files to compile.
-reference Imports metadata from an assembly.
-refonly Outputs only a reference assembly.
-refout Specifies the output path of a reference assembly.
-removeintchecks Disables integer overflow checking.
-resource Embeds a managed resource in an assembly.
-rootnamespace Specifies a namespace for all type declarations.
-ruleset:<file> Specify a ruleset file that disables specific diagnostics.
-sdkpath Specifies the location of Mscorlib.dll and Microsoft.VisualBasic.dll.
-subsystemversion Specifies the minimum version of the subsystem that the generated executable file can use.
-target Specifies the format of the output file.
-utf8output Displays compiler output using UTF-8 encoding.
-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.
-verbose Outputs extra information during compilation.
-warnaserror Promotes warnings to errors.
-win32icon Inserts an .ico file into the output file.
-win32manifest Identifies a user-defined Win32 application manifest file to be embedded into a project's portable executable (PE) file.
-win32resource Inserts a Win32 resource into the output file.

See also