Export (0) Print
Expand All

/debug (Emit Debugging Information)

/debug[+ | -]
/debug:{full | pdbonly}

where:

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

Remarks

The /debug option causes the compiler to generate debugging information and place it in the output file(s). Use this option to create debug builds. If /debug, /debug+, or /debug:full is not specified, you will not be able to debug the output file of your program.

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

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C# Project Properties.
  2. Click the Configuration Properties folder.
  3. Click the Build property page.
  4. Modify the Generate Debugging Information property.

To set this compiler option programmatically

See DebugSymbols Property.

Example

Place debugging information in output file app.exe:

csc /debug /out:app.exe test.cs

See Also

C# Compiler Options

Show:
© 2014 Microsoft