1

Closed

Exception, presumably because of missing class or file: WeakActionGeneric.cs

description

When using a
Messenger<Something>.Send(something) 
method, occasionally a popup comes, titled:
Find Source: WeakActionGeneric.cs
This file selection window starts at the following location:
d:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Helpers\WeakActionGeneric.cs
I can't find the source to that file on my computer, and so I cancel the popup. This leads to the exception, which seems to contain only the following:
System.Reflection.TargetException occurred
  HResult=-2146232829
  Message=Non-static method requires a target.
  Source=mscorlib
  StackTrace:
       at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)
  InnerException: 

This exception and popup become can be seen with all exception checkboxes checked in the VS2012 DEBUG -> Exceptions window. Without any checkboxes checked, a silent failure occurs.
Closed Apr 18, 2013 at 7:16 AM by lbugnion
Duplicate of 7579

comments

lbugnion wrote Apr 18, 2013 at 7:15 AM

Hi,

The message you see asking to see the source code file is just a feature of the Visual Studio debugger. When an exception occurs in a referenced DLL, VS asks you where the file is (in case you have it) in order to allow you to debug. So it is not the cause of the exception, but rather a debug feature triggered by the exception.

The exception itself is a duplicate of Issue 7579.

Thanks
Laurent