I am loading the dll's using reflection and I then try to execute a method in that dll. That method has this line that subscribes to an event. I get an exception at this line
This line is in a dll that I am invoking dynamically using reflection
evntAgg.GetEvent<ExceptionEvent>().Subscribe(Message);
and the exception is something like this:
The Target of the IDelegateReference should be of type System.Action`1[[CustomType, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]. Parameter name: actionReference
this is the event handling method and is in the same dll that I am invoking dynamically
public void Message(ExceptionEvent exception)
{
//Do something
}
Any help would be appreciated?
Message
-method should hasTEventArgs
as parameter, notTEvent
. – Spontifixus