How-To: Show Features Only in Beta Builds | CodeGuru

How-To: Show Features Only in Beta Builds

By Jared Bienz 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”; emailComposeTask.Show(); Now the question is where […]

Written By
CodeGuru Staff
CodeGuru Staff
Aug 20, 2013
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

By Jared Bienz

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";
emailComposeTask.Show();

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”.

clip_image001

In Configuration Manager, choose to create a new configuration.

clip_image002

Call the configuration “Beta” and choose to copy settings from Release.

clip_image003

Click OK to close the dialog.

Make sure “Beta” is selected in the configuration drop-down.

Right click on the project and choose “Properties”.

image

Switch to the “Build” tab.

Add a new conditional compile symbol called BETA.

clip_image004

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;
#endif

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

Reprinted with permission from Microsoft Corporation.

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.