VBC.exe

.Net Visual Basic compiler.

Syntax
 VBC.exe program.vb options
Options
 @(Response-File) A response file.
 -additionalfile Additional files that don’t directly affect code generation but may be used by analyzers for errors/warnings.
 -addmodule:fileList Causes the compiler to make all type information from the specified file(s) available to the project.
 -analyzer Run the analyzers from this assembly (Short form: -a)
 -baseaddress:address The base address when creating a DLL.
 -bugreport:file Create a file that contains information that makes it easy to report a bug.
 -checksumAlgorithm:{SHA1, SHA256}. The algorithm for calculating the source file checksum stored in PDB.
 Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
 -codepage:id The code page to use for all source code files in the compilation.
 -debug:[full | pdbonly] Produce debugging information.
 -define:symbol=value,.. Define symbols for conditional compilation.
 -delaysign Specifies whether the assembly will be fully or partially signed.
 -deterministic Output an assembly whose binary content is identical across compilations if inputs are identical.
 -doc:file Process documentation comments to an XML file.
 -errorreport{ prompt | queue | send | none } Report VB internal compiler errors (ICE) to the VB team at Microsoft.
 -filealign Where to align the sections of the output file,most developers do not need to use this option.
 -help Display compiler options. The same as -? No compilation occurs.
 -highentropyva[+ | -] Support high entropy Address Space Layout Randomization (ASLR).
 -imports:namespaceList Import a namespace from a specified assembly.
 -keycontainer:container A key container name for a key pair to give an assembly a strong name.
 -keyfile:file A file that contains a key or key pair to give an assembly a strong name.
 -langversion:version Language version: 9|9.0|10|10.0|11|11.0.
 -libpath:dirList The location of assemblies referenced by the -reference option.
 -link:fileList Make COM type information in the specified assemblies available to the project.
 -linkresource:filename[,identifier[,public|private]] Create a link to a managed resource.
 -main:location A class that contains the Sub Main procedure to use at startup.
 -moduleassemblyname:assembly_name The name of an assembly that a module will be a part of.
 -modulename: string The name of the source module
 -netcf Set the compiler to target the .NET Compact Framework.
 -noconfig Do not compile with Vbc.rsp.
 -nologo Suppress compiler banner information.
 -nostdlib Causes the compiler not to reference the standard libraries.
 -nowarn[:numberList] Warning ID numbers that the compiler should suppress. If no IDs in list all warnings are suppressed.
 -nowin32manifest Instructs the compiler not to embed any application manifest into the executable file.
 -optimize[ + | - ] Enables or disable code optimization.
 -optioncompare:{binary | text} Whether string comparisons should be binary or use locale-specific text semantics.
 -optionexplicit Enforce explicit declaration of variables, does not override source code statements.
 -optioninfer Enable the use of local type inference in variable declarations.
 -optionstrict Enforces strict language semantics.
 -out:filename The output file.
 -parallel[+|-] Whether to use concurrent build (+).
 -platform{ x86 | x64 | Itanium | arm | anycpu | anycpu32bitpreferred } The processor to target for the output file.
 -preferreduilang The preferred output language name.
 -quiet Prevent the compiler from displaying code for syntax-related errors and warnings.
 -recurse:[dir\]file Search subdirectories for source files to compile.
 -reference:fileList Import metadata from an assembly.
 -refonly Output only a reference assembly.
 -refout:filepath The output path of a reference assembly.
 -removeintchecks[+ | -] Disable [-] or Enable[+] integer overflow checking.
 -resource:filename[,identifier[,public|private]] Embed a managed resource in an assembly.
 -rootnamespace:namespace A namespace for all type declarations.
 -ruleset:file A ruleset file that disables specific diagnostics.
 -sdkpath:path Specifies the location of Mscorlib.dll and Microsoft.VisualBasic.dll.
 -subsystemversion:major.minor The minimum version of the subsystem that the generated executable file can use.
 -target:{exe | library | module | winexe | appcontainerexe | winmdobj} The format of the output file.
 -utf8output Display compiler output using UTF-8 encoding.
 -vbruntime:{ - | + | * | path } Compile with or without a reference to the VB Runtime Library, or with
 a reference to a specific runtime library.
 -verbose Output extra information during compilation.
 -warnaserror Promote warnings to errors.
 -win32icon:filename Insert an .ico file into the output file.
 -win32manifest:fileName A user-defined Win32 application manifest to embed into the project’s portable executable (PE) file.
 -win32resource:filename Insert a Win32 resource into the output file.
 -? Display compiler options. The same as -help. No compilation occurs.

VBC is not on the default system PATH.

The .Net 2.0 vbc.exe is located in the system drive/path at
C:\Windows\Microsoft.NET\Framework\v2.0.50727\vbc.exe

The .Net 4.0 vbc.exe is located in the system drive/path at
C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc.exe

The .Net 2.0 vbc.exe 64 bit is located in the system drive/path at
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\vbc.exe

The .Net 4.0 vbc.exe 64 bit is located in the system drive/path at
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\vbc.exe

Examples

Compile a VB program to create an executable:

C:\> C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc "C:\code\demo.vb" /out:"C:\code\demo.exe" /target:exe

"One resolution I have made, and try always to keep, is this: To rise above little things" ~ John Burroughs

Related commands

Visual Basic command-line compiler - Microsoft

(追記) (追記ここまで)
Copyright © 1999-2026 SS64.com
Some rights reserved

AltStyle によって変換されたページ (->オリジナル) /