XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Questions regarding Debug and Release states.

Last post 07/11/2009 18:54 by Shawn Hargreaves. 2 replies.
  • 07/11/2009 18:50

    Questions regarding Debug and Release states.

    Hi,

    Is there a #define to check if the code is being run from release mode or debug mode? I want to write a block of code that I want to run only when I compile in debug mode and don't compile and run in release mode.

    Thanks
    Try not. Do, or do not. There is no try.
  • 07/11/2009 18:53 In reply to

    Re: Questions regarding Debug and Release states.

    There are already #define variables defined in the project file
    #if DEBUG
    //    SOME CODE HERE
    #endif

    #if RELEASE
    //SOME CODE HERE
    #else
    //SOME CODE HERE
    #endif
  • 07/11/2009 18:54 In reply to

    Re: Questions regarding Debug and Release states.

    What defines are available depends entirely on how you have configured your project. You can set whatever defines you like for each build configuration in the project settings. If you don't change this, the default project templates will give you DEBUG and TRACE defines.

    http://msdn.microsoft.com/en-us/library/2kf0yb05(VS.80).aspx

    http://support.microsoft.com/kb/815788
    XNA Framework Developer - blog - homepage
Page 1 of 1 (3 items) Previous Next