Visual Basic Compiler Options  

/debug

Causes the compiler to generate debugging information and place it in the output file(s).

/debug[+ | -]

-or-

/debug:[full | pdbonly]

Arguments

+ | -
Optional. Specifying +, or just /debug, causes the compiler to generate debugging information and place it in a .pdb file. Specifying -, which is in effect if you do not specify /debug, causes no debug information to be created.
full | pdbonly
Optional. Specifies the type of debugging information generated by the compiler. full, which is in effect if you do not specify /debug:pdbonly, enables attaching a debugger to the running program. pdbonly allows source code debugging when the program is started in the debugger, but displays assembly-language code only when the running program is attached to the debugger.

Remarks

Use this option to create debug builds. If you do not specify /debug, /debug+, or /debug:full, you will be unable to debug the output file of your program.

By default, debugging information is not emitted (/debug-). To emit debugging information, specify /debug or /debug+.

For information on how to configure the debug performance of an application, see Making an Image Easier to Debug.

To set /debug in the Visual Studio integrated development environment

  1. Open the project's Property Pages dialog box. For details, see <Projectname> Property Pages Dialog Box.
  2. Click the Configuration Properties folder.
  3. Click the Build property page.
  4. Select the Generate debugging information check box.

To set /debug programmatically

Example

The following example puts debugging information in output file app.exe:

vbc /debug /out:app.exe test.vb

See Also

Visual Basic Compiler Options | /bugreport | Sample Compilation Command Lines