/debug (C# Compiler Options)
The /debug option causes the compiler to generate debugging information and place it in the output file or files.
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.
If you use /debug:full, be aware that there is some impact on the speed and size of JIT optimized code and a small impact on code quality with /debug:full. We recommend /debug:pdbonly or no PDB for generating release code.
One difference between /debug:pdbonly and /debug:full is that with /debug:full the compiler emits a DebuggableAttribute, which is used to tell the JIT compiler that debug information is available. Therefore, you will get an error if your code contains the DebuggableAttribute set to false if you use /debug:full.
For more information on how to configure the debug performance of an application, see Making an Image Easier to Debug.
To change the location of the .pdb file, see /pdb (C# Compiler Options).
To set this compiler option in the Visual Studio development environment
Open the project's Properties page.
Click the Build property page.
Click the Advanced button.
Modify the Debug Info property.
For information on how to set this compiler option programmatically, see DebugSymbols.