I've begun getting MVVM Light's WeakAction error messages, but can't find out where it's being raised

-1

About 6 weeks ago I started to get errors from MVVM Light's WeakAction, such as this:

System.Reflection.TargetInvocationException HResult=0x80131604 Message=Exception has been thrown by the target of an invocation. Source=mscorlib StackTrace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at GalaSoft.MvvmLight.Helpers.WeakAction.Execute() in c:\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (PCL)\Helpers\WeakAction.cs:line 301 at GalaSoft.MvvmLight.CommandWpf.RelayCommand.Execute(Object parameter) in c:\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (PCL)\Command\RelayCommand.cs:line 220 at System.Windows.Interactivity.InvokeCommandAction.Invoke(Object parameter) at System.Windows.Interactivity.TriggerBase.InvokeActions(Object parameter) 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)

The worst thing about this is whenever is that the call stack is useless to me. It has 2 lines in a MVVM Light's DLL, then lots of system lines having nothing to do with my code until at the last line in the call stack it points to the line in App.xaml.cs that brings up the default window. I've not been able to discern where this is coming from, because in my development I've modified different modules, viewmodels, etc. An error involving WeakAction now comes up very often, throughout the app when I'm debugging. No lines at all in the code I'm working in, base classes inherited from, etc. I've been using MVVM Light for WPF development for 5 years; I've never encountered WeakActions errors before.

As far as I know no new components have been added. No new NuGet packages. No update at all to MVVM Light. I know of no changes to the system. The only thing that's been added is code that two other developers and I are working on. We work in separate dev branches and merge back to Main once a week or every other week. Then merge Main to our separate dev branches. My colleagues haven't added any new components, NuGet packages nor upgraded MVVM Light.

I'm sorry I cannot share more code, but like I said this has begun happening not very long ago to a code base that hasn't had any new outside agencies added to it and no component, NuGet package have been removed. And since the call stack only reveals the 1 line which launches the app at the very beginning, I have no idea where this issue is being generated. How do I go about getting some way of resolving this WeakAction issue so I can debug the app?

c#
wpf
mvvm
mvvm-light
asked on Stack Overflow Apr 16, 2021 by Rod • edited Apr 16, 2021 by Rod

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0