Debugging Silverlight 4 Out of Browser Application


The Silverlight application is by default configured to run inside the browser, but you can configure it to run in Out of Browser mode. And when you debug Silverlight Out of Browser application by default it will be launched in browser, the debugging can also be configured to occur in Out of Browser application window instead of browser.
In this article first we will see how to enable Silverlight application to run Out of Browser and then we will walk through step by step to configure debugging in Out of Browser application window.

Configure Application to run in Out Of Browser mode:

  1. Create project

    Create Silverlight Application project

    DebuggingSilverlight1.gif
     
  2. Enable Out Of Browser

    Right click on Silverlight project and select Properties. From the properties window select Silverlight tab and check the "Enable running application out of browser" checkbox.

    DebuggingSilverlight2.gif

    At this point your application is enabled to run Out Of Browser.
     
  3. Run the application

    I have added a button and a textbock in MainPage. Once the application is launched in browser, right click on it you will get option to install this application in your computer.

    DebuggingSilverlight3.gif

Configure Application to debug in Out Of Browser window:

Here are the steps to enable Out of Browser debugging.

  1. Change project properties

    Right click on Silverlight project and select Debug tab from the project properties. Select "Out-of-browser application" radio button to enable Out of Browser debugging.

    DebuggingSilverlight4.gif
     
  2. Set startup project

    Right click on Silverlight project and select "Set as Startup project".
     
  3. Run the application and debug

    Once all configurations are completed run this application. The application will be launched in Out of Browser window.

    DebuggingSilverlight5.gif

Now you can start debugging you application. To test debugging you my put break point in Debug button click event and then when you click on button the control will stop at you breakpoint.

In this article we have seen how we can configure Silverlight application to run Out of Browser and debug when application is launched in Out of Browser window.

Next Recommended Readings