Fatal exceptions in Silverlight

.NET obfuscator and automated error reporting

Fatal exceptions in Silverlight

Postby mx » Mon Jun 13, 2011 4:17 pm

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.
Posts: 2
Joined: Mon Jun 13, 2011 4:00 pm

Postby Brian Donahue » Mon Jun 13, 2011 6:04 pm

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.
Brian Donahue
Posts: 6590
Joined: Mon Aug 23, 2004 10:48 am

Postby mx » Tue Jun 14, 2011 9:24 am

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?


PS: Also, there is AppDomain.UnhandledException event, which might also help catch some class of exceptions.
Posts: 2
Joined: Mon Jun 13, 2011 4:00 pm

Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 1 guest