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

Questions regarding Debug and Release states.

Last post 11/7/2009 6:54 PM by Shawn Hargreaves. 2 replies.
  • 11/7/2009 6:50 PM

    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.
  • 11/7/2009 6:53 PM 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
  • 11/7/2009 6:54 PM 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