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

From Wiki
Jump to: navigation, search

This article explains how to detect the application's configuration at run time which can be either DEBUG or RELEASE.

WP Metro Icon Bug.png
SignpostIcon XAML 40.png
WP Metro Icon WP8.png
SignpostIcon WP7 70px.png
SignpostIcon Code 52.png
Article Metadata
Tested with
Devices(s): Nokia Lumia 920
Created: pooja_1650 (26 Jul 2013)
Last edited: hamishwillee (20 Nov 2013)



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

Creating UI

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.
App running in Release configuration App running in Debug configuration

Code Behind

Following code snippet is used to check app configuration.

public PivotPage()
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.


This page was last modified on 20 November 2013, at 00:54.
87 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.