Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Blowing past an exception
Message
De
19/12/2009 05:49:20
 
 
À
17/12/2009 06:34:51
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01439539
Message ID:
01439907
Vues:
29
>Hi,
>I have a line of code that throws an ArgumentNullException.
>When this line executes it behaves as if the exception was caught somewhere and silently 'swallowed' - i.e the app continues running
>
>But I don't have any exception handlers that would catch this and if I set the debugger to break when the exception is thrown (rather than just when unhandled) and then continue to step through the code no other code executes and the app continues to run (but stepping kicks in again say for a mousemove event....)
>
>Any clues as to what can cause this behaviour?
>TIA,
>Viv
>
>UPDATE: I get this in the Output window when I continue after the error (code is triggered by an OnDrop():
Step into: Stepping over non-user code 'System.Windows.RoutedEventArgs.InvokeHandler'
>Step into: Stepping over non-user code 'System.Windows.UIElement.RaiseEventImpl'
>Step into: Stepping over non-user code 'System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry'
>Step into: Stepping over non-user code 'System.Windows.ReverseInheritProperty.OnOriginValueChanged'
>Step into: Stepping over non-user code 'System.Windows.Input.MouseDevice.ChangeMouseOver'
>Step into: Stepping over non-user code 'System.Windows.Input.MouseDevice.PreProcessInput'
>Step into: Stepping over non-user code 'System.Windows.Input.InputManager.ProcessStagingArea'
>Step into: Stepping over non-user code 'System.Windows.Input.InputProviderSite.ReportInput'
>Step into: Stepping over non-user code 'System.Windows.Interop.HwndMouseInputProvider.ReportInput'
>Step into: Stepping over non-user code 'System.Windows.Interop.HwndMouseInputProvider.FilterMessage'
>Step into: Stepping over non-user code 'System.Windows.Interop.HwndSource.InputFilterMessage'
>Step into: Stepping over non-user code 'MS.Win32.HwndWrapper.WndProc'
>Step into: Stepping over non-user code 'MS.Win32.HwndSubclass.DispatcherCallbackOperation'
>Step into: Stepping over non-user code 'System.Windows.Threading.ExceptionWrapper.InternalRealCall'
>Step into: Stepping over non-user code 'System.Windows.Threading.ExceptionWrapper.TryCatchWhen'
>Step into: Stepping over non-user code 'System.Windows.Threading.Dispatcher.InvokeImpl'
>Step into: Stepping over non-user code 'MS.Win32.HwndSubclass.SubclassWndProc'
>Step into: Stepping over non-user code 'System.Windows.Threading.Dispatcher.PushFrameImpl'
Only thing I can think of is that something is swallowing it in there......

I think I've worked out what is happening here. If the object being dropped is from within the application then the exception is raised as expected. If, however, the drop object is external to the appliction (e.g. a file from Windows Explorer) then the exception is handled by the drag initiator.

AFAICS this is a bit nasty - the implication being that unless all the code in any OnDrop() method is wrapped in a try/catch block and any exception is safely handled there you can have serious problems!

Thoughts ?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform