debug vs release
-
Friday, September 02, 2005 8:40 AMhi, what diferences are betwen "debug" and "release" binary file version of project ?
All Replies
-
Friday, September 02, 2005 9:11 AMModerator
Debug build contain debug symbols and can be debugged while Release build doesn’t contain debug symbols and cannot be debugged. Hence Release build will perform faster compared to a Debug build binary.
Also When an application is built using Debug build, a .pdb file is generated in the bin folder while this does not happen in Release build.
Regards,
Vikram -
Tuesday, September 06, 2005 3:17 PMCan i set compling some code only in debug ?
-
Tuesday, September 06, 2005 3:26 PMModerator
Hi,
Yes you can.
Check the Conditional Attribute:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/vclrfcsharpspec_17_4_2.asp
You can also have code with in #if directives
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfif.asp
Regards,
Vikram -
Tuesday, September 06, 2005 9:26 PMModerator
Just to compliment Vikram's information:
You can debug release versions (without disabling optimisations) in .NET 2.0, by doing the following:
1. In Solution Explorer, right-click the Project node and click Properties
2. In the Properties window, select the Debug tab
3. Change Configuration to Release
4. Under Output, click Advanced...
5. In Advanced Build Settings, change Debug Info to pdb-only
This will generate pdb debug symbols for debugging a release version.
To using conditional directives:
#if DEBUG
MessageBox.Show("Debug");
#endif

