Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Detecting app release/debug configuration
This article explains how to detect the application's configuration at run time which can be either DEBUG or RELEASE.
At times, it is required to know about the configuration at run time under which the app is running. Possible scenarios are: to set some settings when the app is running under DEBUG mode only or to maintain logs when the app is not running with RELEASE configuration. In all such scenarios, knowing the configuration at run time can be very handy.
- Windows Phone development environment
To showcase the usefulness of detecting app configuration we will simply create a pivot page having default pivot item release having some UI controls. When the app will run under DEBUG configuration, we will create and show a new pivot item debug.
Following code snippet is used to check app configuration.
public void CheckConfiguration()
PivotItem debugPivotItem = new PivotItem();
debugPivotItem.Header = "debug";
// add PivotItem content
Build and Run
Now you may build the app and try to run it under both configurations to see the effects.
This way we can detect the app's configuration at run time.