Silverlight Error Handling Default Behavior

 

What actually happens when exceptions occur inside the managed code of a Silverlight application can be a little confusing at first.  Factors that affect what you will see depend on:

  • Whether or not the app is being run by the Visual Studio debugger
  • Whether or not Silverlight debugging is enabled
  • Whether or not the offending code is in a try/catch block
  • Whether or not the Applicaiton.UnhandledException event has a handler
  • Whether or not the Silverlight Plug-in has an onError handler in JavaScript
  • Whether or not script debugging is enabled in IE

That’s a lot of “Whether or not”s to deal with. To try and make sense of it, I have created the following flow chart.  Be warned, this is how I see it, and what my testing has shown me.  Your mileage may vary.  Also, this all assumes that you are using Internet Explorer as the browser.  The browser portion of the following information will be different with each browser.  Click the image or link below to download a zip file with the Visio document, a PNG, and a PDF of the flowchart.

Silverlight Error Handling Default BehaviorSilverlightErrorHandlingDefaultBehavior.zip

If you have any input, drop a comment below and let me know.  As always though the files I am posting are yours to do with as you wish, I retain no rights. 

Leave a Reply