Home > Mobile > How-To: Show Features Only in Beta Builds

How-To: Show Features Only in Beta Builds

I was recently asked how to add a “Submit a Bug” feature to an app but only make it visible for Beta builds.


The code to actually send the bug was quite simple:


EmailComposeTask emailComposeTask = new EmailComposeTask();

emailComposeTask.Subject = "My App Feedback";

emailComposeTask.To = "feedback@mydomain.com";



Now the question is where to put it. Obviously this could be triggered from a button click, a menu item, or any other control on the screen. But if we only want the item to show up on beta builds we have some extra work to do.

One of the ways I like to deal with this is by adding a new configuration to the Configuration Manager.

In Visual Studio click the Configuration drop-down and choose ‘Configuration Manager’.


In Configuration Manager, choose to create a new configuration.


Call the configuration ‘Beta’ and choose to copy settings from Release.


Click OK to close the dialog.

Make sure ‘Beta’ is selected in the configuration drop-down.

Right click on the project and choose ‘Properties’.


Switch to the ‘Build’ tab.

Add a new conditional compile symbol called BETA.


Close the project properties window and make sure you saved your changes.

Now, anywhere in the code you can use BETA as a conditional compile statement.


#if BETA

contactButton.Visibility = Visibility.Visible;



Now you can easily switch between Debug, Release and Beta builds using the configuration drop-down at the top in Visual Studio!

Categories: Mobile Tags: ,
  1. No comments yet.
  1. August 13, 2013 at 9:40 pm

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: