Chapter 5. Building and Testing Your Application

As you are building your application, it is always a good idea to test it to ensure that it functions the way that you expect. In addition to the standard debugging features available in all versions of Visual Studio, Visual Studio 2010 Express for Windows Phone provides a phone emulator, which allows you to test your application using a virtual phone.

BUILDING YOUR APPLICATION

As you progress through the development of your application, it is a good practice occasionally to build your app to verify that the code you have written will actually compile. Just because the IDE does not point out any errors in your code does not guarantee that your code will compile.

Before You Build

You can build your application in either of two different modes: Debug and Release. As you are developing your application you will typically build in Debug mode. Debug mode enables you to test your application. If an exception is thrown, Debug mode will switch focus to the IDE, highlight the code that threw the exception, and display a dialog box containing the details of the exception, as shown in Figure 5-1.

After you have thoroughly tested your application both using the Emulator and an actual phone device, you can build your app in Release mode. If you are using Visual Studio 2010 Express for Windows Phone, you may notice that there is no build-type selector in the toolbar. To switch to Release mode in the Express edition, click Project on the main menu and ...

Get Windows® Phone 7 Application Development 24-Hour Trainer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.