Skip to main content

Microsoft Silverlight

Unanswered Question ApplicationUnhandledException not thrownRSS Feed

(0)

jjy2
jjy2

Member

Member

354 points

155 Posts

ApplicationUnhandledException not thrown

 

ApplicationUnhandledException is not called if user codes throw exception during particular event handling
(such as Loaded, MouseLeftButtonDown etc..)

It seems it's caught inside framework and codes executes continusly as if nothing happened.

I got it working only if javascript calls C# class object's method and if I throw an exception in that method. 

I realized that I have to put try--cath in almost every event handling routines.

Is this by design? 

 

VladF
VladF

Member

Member

216 points

87 Posts

Re: ApplicationUnhandledException not thrown

Menu Debug | Exceptions -> check all the checks you need. For some reason they are unchecked by default.

jjy2
jjy2

Member

Member

354 points

155 Posts

Re: ApplicationUnhandledException not thrown

Hi VladF

Thanks for that. I now enabled just about every type of break in debugger.

But I still need ApplicationUnhandledException to be called at runtime so that my application can take appropriate action.
Hope this will be fixed in the release

 

 

jjy2
jjy2

Member

Member

354 points

155 Posts

Re: ApplicationUnhandledException not called.

I think I need to clarify this as I saw similar issues in the other posts

It seems we have 3 different but related issues

  1. Debugger does not break non-user code -- which is normal behaviour as VladF pointed out
  2. When there are uncaughted exceptions, sometimes framework emits the error message with messagebox sometimes it doesn't.
  3. WebApplication.Current.ApplicationUnhandledException event suggested by its name that we can handle unhandled exception using this event but this event is sometimes called and sometimes not.

     

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities