locked
Debug Mode vs Release Mode RRS feed

  • Question

  • I am working through a beginning C# book which is attempting to demonstrate the Debug.WriteLine and Trace.WriteLine functionality in both Debug and Release mode configurations.  The book states to simply choose the release mode option from the standard toolbar.

    I believe that the book is assuming the use of the full blown version of Visual Studio 2005, whereas I am using Visual C# 2005 Express Edition.  I see a drop down box in the standard toolbar that, when rolled over, shows solution configurations.  However, this box is grayed out and not accessible.

    Is there some configuration setting that needs to be made in order to "activate" this drop down box?  I have perused the help system, message boards, and various options/settings dialog boxes inside the IDE, but I am unable to find anything to assist me.  I am not sure whether this debug vs release mode may only be a VS2005 option rather than an express edition option.  Any help or direction would be appreciated.

    Dave

    Thursday, March 23, 2006 4:21 PM

Answers

  • Express is kind of funny with regards to building...

    In VS2005 (like all full versions of Visual Studio) when you build in either Release or Debug mode, separate files are output to separate directories with separate rules... Express on the other hand, being a stripped down version of Visual Studio lacks a number of these things.

    In short, when you build your C# app in Express, both a Release and Debug version are created into the appropriate directories inside of your projects bin dir. The main difference between the two is that the Debug version includes a symbols file (the pdb file).

    Because in Express you do not have the separation of build modes as obvious as you do in Visual Studio you should take a look at your project properties and click on the Build Tab. Once there, take a look at the options “Define DEBUG constant” and “Define TRACE constant”.

    In Visual Studio, a project built in debug mode has both of those options checked, while one built in release mode under Visual Studio will have the debug constant unchecked.

    I should mention that there is an indirect way to enable the build profiles in Express... but not through the IDE, instead your project and/or solution must define the multiple build profiles and when used in Express you will have access to them.

    Does this answer your question?

    Thursday, March 23, 2006 7:02 PM
  • The UI has this ability, just disabled by default.
    Go to Tools -> Options.
    On the lower left corner enable the "Show all settings" checkbox.
    Click on "Projects and sollutions" and enable "Enable advanced build configurations"

    This will enable the Release and Debug target in your Visual studio interface.
    (next to the run button)

    Saturday, March 25, 2006 6:06 PM

All replies

  • Express is kind of funny with regards to building...

    In VS2005 (like all full versions of Visual Studio) when you build in either Release or Debug mode, separate files are output to separate directories with separate rules... Express on the other hand, being a stripped down version of Visual Studio lacks a number of these things.

    In short, when you build your C# app in Express, both a Release and Debug version are created into the appropriate directories inside of your projects bin dir. The main difference between the two is that the Debug version includes a symbols file (the pdb file).

    Because in Express you do not have the separation of build modes as obvious as you do in Visual Studio you should take a look at your project properties and click on the Build Tab. Once there, take a look at the options “Define DEBUG constant” and “Define TRACE constant”.

    In Visual Studio, a project built in debug mode has both of those options checked, while one built in release mode under Visual Studio will have the debug constant unchecked.

    I should mention that there is an indirect way to enable the build profiles in Express... but not through the IDE, instead your project and/or solution must define the multiple build profiles and when used in Express you will have access to them.

    Does this answer your question?

    Thursday, March 23, 2006 7:02 PM
  • Thanks Brendan.  I understand completely and your explanation was both very thorough and very clear.  Thanks to people like you, people like me just starting out learn a heck of a lot more.  Thanks again!

    Dave

     

    Friday, March 24, 2006 2:21 PM
  • The UI has this ability, just disabled by default.
    Go to Tools -> Options.
    On the lower left corner enable the "Show all settings" checkbox.
    Click on "Projects and sollutions" and enable "Enable advanced build configurations"

    This will enable the Release and Debug target in your Visual studio interface.
    (next to the run button)

    Saturday, March 25, 2006 6:06 PM
  • Very good Ger Teunis!  Thank you very much for pointing this out.  Not necessarily the most intuitive way to enable the functionality, but now that I have seen it, it will not be forgotten.  Thanks again!
    Monday, March 27, 2006 8:10 PM