VB.NET 1.1 Tutorial - Command Line Compiler OptionsMost Visual Basic applications can be compiled without using any of the specialized compiler options. However, during the development process in particular, you may want to use some of the options that the compiler offers. All of the compiler options are listed in the .NET Framework SDK Documentation that is shipped with the SDK. Here we will take a look at a few of the options. The /out optionThe /out compiler option specifies the name of the output file. If you do not specify the name of the output file:
vbc /t:winexe /r:system.dll,system.windows.forms.dll /out:MyProject *.vb The /target optionThe /target compiler option can be specified in one of four forms:
The /target compiler option can be shortened to /t. The /target:exe option causes the compiler to create an executable (EXE), console application. This option is the default, so if no /target: is supplied, this will be used. The executable file will be created with the .exe extension. vbc /t:exe /r:system.dll file.vb The /target:library option causes the compiler to create a dynamic-link library (DLL) rather than an executable file (EXE). The DLL will be created with the .dll extension. vbc /t:library /r:system.dll file.vb To not generate an assembly manifest, use the /target:module option. By default, the output file will have an extension of .netmodule. vbc /t:module /r:system.dll file.vb The /target:winexe option causes the compiler to create an executable (EXE), Windows program. The executable file will be created with the .exe extension. A Windows program is one that provides a user interface from either the .NET Framework library or with the Win32 APIs. vbc /t:winexe /r:system.dll,system.windows.forms.dll file.vb The /help optionThis option sends a listing of compiler options, and a brief description of each option, to stdout. If this option is included in a compilation, no output file will be created and no compilation will take place. vbc /help ReferencesFor more information on the Visual Basic Compiler Options, visit MSDN at microsoft here What Next?Lets take a look at comments. Return to the Tutorial Contents. |