Answered debug vs release

  • Friday, September 02, 2005 8:40 AM
     
     
    hi, what diferences are betwen "debug" and "release" binary file version of project ?

All Replies

  • Friday, September 02, 2005 9:11 AM
    Moderator
     
     Answered
    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 PM
     
     
    Can i set compling some code only in debug ?
  • Tuesday, September 06, 2005 3:26 PM
    Moderator
     
     Answered
  • Tuesday, September 06, 2005 9:26 PM
    Moderator
     
     Answered
    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