Exceptions being logged

Topics: Bootstrappers & IoC, Getting Started
Oct 9, 2011 at 1:57 PM

Hi,

I'm quite new to WPF and Caliburn.Micro (enjoying so far). Have implemented event log logging for unhandled exceptions, but the same thing gets logged each time...Does this look right? When in debug mode in VS, it gets stuck looking for a file...It did this with either the package from Nuget or a clone of the repository locally...

Obviously I'd like to log the exception from my code that caused this...my guess is that this is deliberate? -- i'm catching my exception at the wrong point in time...

sorry!

   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Caliburn.Micro.ActionMessage.<.cctor>b__d(ActionExecutionContext context) in C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\ActionMessage.cs:line 278
   at Caliburn.Micro.ActionMessage.Invoke(Object eventArgs) in C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\ActionMessage.cs:line 239
   at System.Windows.Interactivity.TriggerAction.CallInvoke(Object parameter)
   at System.Windows.Interactivity.TriggerBase.InvokeActions(Object parameter)
   at System.Windows.Interactivity.EventTriggerBase.OnEvent(EventArgs eventArgs)
   at System.Windows.Interactivity.EventTriggerBase.OnEventImpl(Object sender, EventArgs eventArgs)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

Oct 9, 2011 at 9:13 PM

Sorry, I can't really understand your issue. The stack trace seem to refer to an action invocation triggered by a button click, but I'm failing to guess what file VS is searching for (the source code for the class getting the exception, perhaps?)
A repro could be really useful to understand your scenario a bit more.
If you get the chance to build a simple project demonstrating the issue, please send it to marco dot amendola at gmail dot com.

Oct 10, 2011 at 2:33 AM

Thanks for replying, I'll try and put together a quick sample app when I get a chance...but here is the text from the message that Visual Studio presents:

No Source Available
There is no source code available for the current location.

To investigate further, try one of these options:

Browse to Find Source

Show Disassembly

 

Call stack location:

Caliburn.Micro.dll!Caliburn.Micro.ActionMessage.Invoke(object eventArgs) Line 240

Source file information:

Locating source for 'C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\ActionMessage.cs'. Checksum: MD5 {aa b1 f f5 23 5 ba a1 51 b4 11 ea 76 24 a0 e5}
The file 'C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\ActionMessage.cs' does not exist.
Looking in script documents for 'C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\ActionMessage.cs'...
Looking in the projects for 'C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\ActionMessage.cs'.
The file was not found in a project.Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\ActionMessage.cs.
The debugger could not locate the source file 'C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\ActionMessage.cs'.

Oct 10, 2011 at 9:05 AM

My guess was correct: VS seem to be searching for the source code of ActionMessage in order to display it in the debugger.
It should be a normal behavior, since you are using a binary version not built on your machine.
I can't tell, however, what exception are you getting...