Array

Debugging Windows Phone 7 Applications

Must Read

Refinance Home Loan: Consider Refinancing Your Home Equity Line of Credit

If you are a homeowner with a Home Equity Line of Credit (HELOC) in addition to your mortgage, you...

How to Pay College Tuition Costs

If you are reading this article you obviously you have college tuition costs to pay and you want to...

Student Loan Consolidation Program – Some Important Debt Advice to Heed

Student loan consolidation program for university and college students is an important option, especially if they find themselves suffering...
Admin
test

If you are working in Visual Studio or Visual Studio Express, you can use the standard debugging tools to break, step through, and profile a Windows Phone 7 application. You can also view variable values and the execution tree and processes.

A Windows Phone 7 application uses Silverlight and Windows Presentation Foundation (WPF) to define the interfaces, so any debugging techniques you use in Silverlight and WPF also apply to Windows Phone 7. For example, there are some specific issues related to WPF styling and data binding that can arise in an application. These include the following:

  • Errors in the auto-generated partial class for a XAML component that prevent the component from being available to code in the page or the application. In most cases, you can  resolve this by right-clicking the XAML file in Solution Explorer and then clicking Run Custom Tool to regenerate the partialclass.
  • Errors in the XAML style definitions for components. These may occur in the App.xaml file or in other files within your application. Typically, the exception message indicates only that a COM component error has occurred and provides an HRESULT value. The simplest approach to resolving these types of errors are to minimize the surface area by temporarily removing some or all of the XAML styling definitions until the error disappears, and then reading them one by one to locate the faulty definition.
  • Data binding errors, such as using the wrong property name in a binding statement. This does not generate a run-time error, but the control property (such as the text) is not set. You can see a list of data binding errors in the Output window of Visual Studio or Visual Studio Express as the application executes. For example, you will see the following message if you specify binding to a property named City that does not exist in the data context.System.Windows.Data Error: BindingExpression path error:
    ‘City’ property not found on [your data context component
    name]. BindingExpression: Path=’City’ DataItem=’[your
    data context item]’; target element is ‘System.Windows.
    Controls.TextBlock’ (Name=’ItemText’); target property
    is ‘Text’ (type ‘System.String’).

     

  • Remote service access errors. If your application cannot retrieve data from a remote service, try copying the URL of the service from your code into a web browser to see if it is accessible. You can also download and install a web debugging proxy utility such as Fiddler or a similar utility to view all the HTTP(S) traffic between your application and the service. Fiddler is available from the Fiddler website (http://www.fiddler2.com/fiddler2/).

One specific point to note when debugging Windows Phone 7 applications using the emulator is that certain actions within the phone may halt the debugger. For example, if the code opens a task or the launcher, or if it is tombstoned, execution may not continue automatically after the interruption. To continue debugging, press F5 in Visual Studio within 10 seconds of the task completing or the applications being reactivated.

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest News

Top 10 Provinces of Thailand Not to be missed for Travel

10 SuratthaniThe source of the proverbial Chaiya salted egg. Surat Thani is a province with many attractions,...

Underlight As Accent, For Power and The Main Light for Photography

Underlighting, in which fill or accent light comes from under the topic, is not widely used technique in the traditional Portraits, even though it will have...

How To Fix Overexposure As A Creative Tool, The Complete Guide

As an creative tool, overexposure is sort of underrated. What I’m close to propose could be a deliberate and well thought out technique for...

7D Mark II is Canon’s best DSLR cameras without full-frame sensor.

The expected long-awaited Canon EOS 7D Mark II are shipping in November for $ 1,799 without a lens. With a higher price tag, you...

Low key photography and How to isolate your subject.

Low key photography doesn’t depend on underexposure to make its point; the key to low key is that the majority of tones, even correctly...

More Articles Like This