If you’re doing any kind of Silverlight work you’re bound to get “Error on page” in Internet Explorer. Here’s what I’m talking about.
You fire up your app in the browser window and BLAM. Screen is empty and you get the “Error in page” error. Double click the error and you get an Internet Explorer JS Error Window. Here it is in all its glory:
How Do I Catch The Exception in Code?
The exception IS happening in code you’re just not catching un-handled exceptions.
To turn them on, go to Debug –> Exceptions:
You’ll get the window below. Check the “Common Language Runtime Exceptions” checkbox and click OK.
You will not get exceptions bubbled up to the Dev Environment. Here’s what it looks like in action (with the same error as the “blank screen” above).
Click “Break” and break into the area where the code barfed on you, and then clean up the mess you’ve created (on accident of course – who creates un-handled exceptions for fun anyway). ๐
Enjoy.
Leave a Reply
You must be logged in to post a comment.