Back to Roslyn

Visual Basic Compiler Options

docs/compilers/Visual Basic/CommandLine.md

11.0.1007.5 KB
Original Source

Visual Basic Compiler Options

FLAGDESCRIPTION
OUTPUT FILE
/out:fileSpecifies the output file name.
/refout:fileSpecify the reference assembly's output file name
/target:exeCreate a console application (default). (Short form: /t)
/target:winexeCreate a Windows application.
/target:libraryCreate a library assembly.
/target:moduleCreate a module that can be added to an assembly.
/target:appcontainerexeCreate a Windows application that runs in AppContainer.
/target:winmdobjCreate a Windows Metadata intermediate file
/doc{+|-}Generates XML documentation file.
/doc:fileGenerates XML documentation file to file.
INPUT FILES
/addmodule:file_listReference metadata from the specified modules
/link:file_listEmbed metadata from the specified interop assembly. (Short form: /l)
/recurse:wildcardInclude all files in the current directory and subdirectories according to the wildcard specifications.
/reference:file_listReference metadata from the specified assembly. (Short form: /r)
/analyzer:file_listRun the analyzers from this assembly (Short form: /a)
/additionalfile:file listAdditional files that don't directly affect code generation but may be used by analyzers for producing errors or warnings.
RESOURCES
/linkresource:resinfoLink the specified resource to this assembly (Short form: /linkres) Where the resinfo format is file{,string name{`,public
/resource:resinfoEmbed the specified resource (Short form: /res)
/nowin32manifestThe default manifest should not be embedded in the manifest section of the output PE.
/win32icon:fileSpecifies a Win32 icon file (.ico) for the default Win32 resources.
/win32manifest:fileThe provided file is embedded in the manifest section of the output PE.
/win32resource:fileSpecifies a Win32 resource file (.res).
CODE GENERATION
/debug{+|-}Emit debugging information.
/debug:fullEmit debugging information to .pdb file using default format for the current platform: Windows PDB on Windows, Portable PDB on other systems
/debug:pdbonlySame as /debug:full. For backward compatibility.
/debug:portableEmit debugging information to to .pdb file using cross-platform Portable PDB format
/debug:embeddedEmit debugging information into the .dll/.exe itself (.pdb file is not produced) using Portable PDB format.
/sourcelink:fileSource link info to embed into PDB.
/optimize{+|-}Enable optimizations.
/removeintchecks{+|-}Remove integer checks. Default off.
/debug:fullEmit full debugging information (default).
/debug:portableEmit debugging information in the portable format.
/debug:pdbonlyEmit PDB file only.
/deterministicProduce a deterministic assembly (including module version GUID and timestamp)
`/refonlyProduce a reference assembly, instead of a full assembly, as the primary output
ERRORS AND WARNINGS
/nowarnDisable all warnings.
/nowarn:number_listDisable a list of individual warnings.
/warnaserror{+|-}Treat all warnings as errors.
/warnaserror{+|-}:number_listTreat a list of warnings as errors.
/ruleset:fileSpecify a ruleset file that disables specific diagnostics.
/errorlog:fileSpecify a file to log all compiler and analyzer diagnostics.
/reportanalyzerReport additional analyzer information, such as execution time.
LANGUAGE
/define:symbol_listDeclare global conditional compilation symbol(s). symbol_list is name=value,... (Short form: /d)
/imports:import_listDeclare global Imports for namespaces in referenced metadata files. import_list is namespace,...
/langversion:?Display the allowed values for language version
/langversion:stringSpecify language version such as default (latest major version), or latest (latest version, including minor versions)
/optionexplicit{+|-}Require explicit declaration of variables.
/optioninfer{+|-}Allow type inference of variables.
/rootnamespace:stringSpecifies the root Namespace for all top-level type declarations.
/optionstrict{+|-}Enforce strict language semantics.
/optionstrict:customWarn when strict language semantics are not respected.
/optioncompare:binarySpecifies binary-style string comparisons. This is the default.
/optioncompare:textSpecifies text-style string comparisons.
MISCELLANEOUS
/helpDisplay a usage message. (Short form: /?)
/noconfigDo not auto-include VBC.RSP file.
/nologoDo not display compiler copyright banner.
/quietQuiet output mode.
/verboseDisplay verbose messages.
/parallel{+|-}Concurrent build.
ADVANCED
/baseaddress:numberThe base address for a library or module (hex).
/bugreport:fileCreate bug report file.
/checksumalgorithm:algSpecify algorithm for calculating source file checksum stored in PDB. Supported values are: SHA1 (default) or SHA256.
/codepage:numberSpecifies the codepage to use when opening source files.
/delaysign{+|-}Delay-sign the assembly using only the public portion of the strong name key.
/errorreport:stringSpecifies how to handle internal compiler errors; must be prompt, send, none, or queue (default).
/filealign:numberSpecify the alignment used for output file sections.
/highentropyva{+|-}Enable high-entropy ASLR.
/keycontainer:stringSpecifies a strong name key container.
/keyfile:fileSpecifies a strong name key file.
/libpath:path_listList of directories to search for metadata references. (Semi-colon delimited.)
/main:classSpecifies the Class or Module that contains Sub Main. It can also be a Class that inherits from System.Windows.Forms.Form. (Short form: /m)
/moduleassemblyname:stringName of the assembly which this module will be a part of.
/netcfTarget the .NET Compact Framework.
/nostdlibDo not reference standard libraries (system.dll and VBC.RSP file).
/pathmap:k1=v1,k2=v2,...Specify a mapping for source path names output by the compiler. Two consecutive separator characters are treated as a single character that is part of the key or value (i.e. == stands for = and ,, for ,).
/platform:stringLimit which platforms this code can run on; must be x86, x64, Itanium, arm, AnyCPU32BitPreferred or anycpu (default).
/preferreduilangSpecify the preferred output language name.
/sdkpath:pathLocation of the .NET Framework SDK directory (mscorlib.dll).
/subsystemversion:versionSpecify subsystem version of the output PE. version is number{.number}
/utf8output{+|-}Emit compiler output in UTF8 character encoding.
@fileInsert command-line settings from a text file
/vbruntime{+|-|*}Compile with/without the default Visual Basic runtime.
/vbruntime:fileCompile with the alternate Visual Basic runtime in file.