This documentation is archived and is not being maintained.

What's New in the Visual Basic Compiler 

Visual Basic 2005 includes new compiler options and other compiler changes.

Conditional Compilation

Visual Basic introduces the following new conditional-compilation constants for all projects:

  • TRACE. a Boolean value you can set to specify that methods of the Trace class generate output to the Output window.

  • VBC_VER. the Visual Basic version, in major.minor format. For Visual Basic 2005, the value of VBC_VER is 8.0.

For more information, see Conditional Compilation Constants

Default Command-Line Options in Vbc.rsp

The Visual Basic command-line compiler now stores the default command-line options in the Vbc.rsp file, in the same directory as the command-line compiler, Vbc.exe. You can edit Vbc.rsp to reconfigure the default command-line options.

New Command-Line Options

There are seven new command-line compiler options:

  • The /codepage option specifies which code page to use when opening source files.

  • The /doc option generates an XML documentation file based on comments within your code.

  • The /errorreport option provides a convenient way to report a Visual Basic internal compiler error to Microsoft.

  • The /filealign option specifies the size of sections in your output file.

  • The /noconfig option specifies that the compiler should not automatically reference the commonly used .NET Framework assemblies or import the System and Microsoft.VisualBasic namespaces.

  • The /nostdlib option removes the automatic reference to the System.dll assembly and other commonly used assemblies.

  • The /platform option specifies the processor to be targeted by the output file, in those situations where it is necessary to explicitly specify it.

/nowarn and /warnaserror

The /nowarn and /warnaserror options provide more control over how warnings are handled. These compiler options now takes a list of warning IDs as an optional parameter, to specify to which warnings the option applies.

See Also