Debugging for Nokia S60

Microsoft Silverlight will reach end of support after October 2021. Learn more.

This topic provides tips for debugging applications that are based on Silverlight for Symbian. For information about creating Silverlight-based applications for Nokia S60, see Getting Started with Silverlight for Symbian.

Displaying Unhandled Exceptions Inside the JavaScript Window

Visual Studio creates an error handler for each Silverlight-based application that is created. Whenever an unhandled exception is encountered within a Silverlight-based application, the browser catches these exceptions and displays them as a yellow icon in Internet Explorer, and as an Error Console in Firefox. However, these errors are not displayed on S60 by default.

To display unhandled exceptions

  1. Make the following modifications in the SilverlightError() method in TestPage.html.

    Replace

    throw new Error(errMsg);
    

    with

    //throw new Error(errMsg);
    alert(errMsg);
    
  2. Make the following modifications in the ReportErrorToDOM() method in App.xaml.cs. Replace

    System.Windows.Browser.HtmlPage.Window.Eval()
    

    with

    System.Windows.Browser.HtmlPage.Window.Alert()
    
  3. Enable the display of JavaScript errors in the S60 browser by clicking Options, Settings, General, and then Java/ECMA script errors – Show pop-up notes.

Troubleshooting Application Errors

The following issues are common during the initial debugging phase of application development.

Browser Closes When Application Is Running

When you create an application, you must change the default <object> tag to a value that is supported on Nokia S60 devices. If you do not, the application will fail and the browser will close. See "How to Create a Silverlight-Based Application for S60" in Getting Started with Silverlight for Symbian for detailed information.

Application Fails to Load on the Emulator

When you create an application, you must change the default anchor tag: <a href="" />. If you do not, the application will fail to load on the emulator. For detailed information, see "How to Create a Silverlight-Based Application for S60" in Getting Started with Silverlight for Symbian.

Application Fails or Unexpected Behavior Occurs

When you debug your application, it is important to understand the issues that you might experience because of platform limitations. For more information, see Platform Limitations on Nokia S60.

See Also

Other Resources