Fatal exceptions in Silverlight

mxmx Posts: 3
edited June 14, 2011 4:24AM in SmartAssembly
Hi,
I downloaded and tried SmartAssembly and noticed that it does not report exceptions after which Silverlight stops rendering UI. These exceptions sometimes happen and it would be very nice if SmartAssembly could report them too.

Simple way to simulate this is for example to throw an Exception in MainWnd constructor.

My question is - do you plan to add some support for these fatal exceptions too?

Thanks, M.

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    I've noticed this as well and reported it to development. Basically any exceptions in Silverlight that happen before the UI is initialized or after it's torn down do not trip the unhandled exception handler so exceptions do not get reported.

    For instance something happening in the app's constructor does not trigger an error report, but if something happens in the load event of the main window it does.

    I don't know at this point if this is possible to fix given the current design of SmartAssembly. I'll need to bring the issue up again.
  • For me, the Application.UnhandledException is always called (of course except exceptions which happen before UnhandledException event is hooked up). But not always UI works at the time when unhandled exception is catched which might be what is the problem for SmartAssembly, because Silverlight will not display its dialog and SmartAssembly seems to depend upon this.

    In my applications I solve this by waiting 1000ms for the error dialog to open and if it does not I either use javascript DOM to report the exception (if running inside browser) or report the exception to the server without user's confirmation (if running out of browser).

    But maybe there are even better solutions on assembly rewriting level?

    M.

    PS: Also, there is AppDomain.UnhandledException event, which might also help catch some class of exceptions.
Sign In or Register to comment.