Home » Silverlight | Articles

Debug a Silverlight out of browser application… out of the browser

11. September 2010 by Juliën Hanssens 0 Comments

The out of browser experience introduced in Silverlight 3 has been optimized in version 4. And it’s a blast! But one minor frustration which wasn’t immediately obvious for me is that, by default, when you debug a Silverlight application it opens the default browser and runs your app in it. Setting it as the default startup program didn’t do the trick.

Now, the only thing I really want to do is hit F5 and run the out of browser (OOB) version. Period. And in  Silverlight 4 it’s actually quite simple to enable this in a matter of seconds. It only requires three small actions on your part, which I’ve conveniently divided into the following five small steps.

 

  1. Create a new Silverlight 4 project (or use an existing one) and host it in a Web project.
    Behold your fresh project:
    SilverlightOutOfBrowser
  2. Rightclick the OutOfBrowser project and select “Set as StartUp project
  3. Open the project properties for the same OutOfBrowser project
  4. On the Silverlight tab, select the “Enable running application out of the browser” option.
  5. On the Debug tab, confirm that the “out-of-browser application” dropdown is set to OutOfBrowser.Web

The last part is actually a case of optical deceit. Once you run this, it’ll work as planned. You think you are just running the app and you think that the .Web project is left alone but in fact you’re just being “Houdini-d”. Step 5 actually, or magically, loads the .Web project in the background as a host. The only benefits are that you’re just not confronted with it anymore and that performance of booting up a debug instance is noticeably improved.

Comments are closed