Command-Line Switches

The VB.NET compiler supports the following command-line switches.

Output Filename and File Type

Switch

Description

/out:<file>

Defines the output filename. If not present, the output file will have the same root filename as the input file. <file> can be the root filename without a file extension.

/target:<type>

or:

/t:<type>

Defines the type of file to be generated by the compiler. <type> can be any of the following keywords: exe (to create a console application), winexe (to create a Windows application), library (to create a library assembly in a DLL), and module (to create a .NETMODULE file that can be added to an assembly). If the switch is not present, type defaults to exe, and the compiler attempts to create a console application.

Input Files

Switch

Description

/addmodule:<file>

Includes the .NETMODULE file named <file> in the output file.

/libpath:<path_list>

The directory or directories to search for metadata references (which are specified by the /reference switch) that are not found in either the current directory or the CLR’s system directory. <path_list> is a list of directories, with multiple directories separated by commas or semicolons. Note that /libpath is additive; using multiple switches adds <path_list> to existing paths rather than replacing the existing ones.

/recurse:<wildcard>

Includes all files in the current directory and its subdirectories according to the wildcard specifications. For example:

vbc /recurse:*.vb ...

Get VB.NET Language in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.