1
Vote

Reflection Error - Resolution Included

description

Cannot thank you enough for this module - love it. I did run into an issue though in that the Events would not show up with the native Orchard Content Events. Come to find out it was a "reflection" issue. To fix the issue, I had to change your "ContentEvents.cs" to "AuditContentEvents.cs" (which changed the class name as well as the constructor name). I also had to change your "ContentForms.cs" to "AuditContentForms.cs" (which also changed the class name as well as the constructor name). After this, everything works fine.

Here was was the actual error message:

2012-05-11 11:02:16,283 [11] Orchard.Exceptions.DefaultExceptionPolicy - An unexpected exception was caught
System.Reflection.TargetException: Object does not match target type.
at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)
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 Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String methodName, IDictionary2 arguments, IEnumerable& returnValue) in C:\Users\jeff.olmstead\EMS\src\Orchard\Events\DefaultOrchardEventBus.cs:line 83
at Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String interfaceName, String methodName, IDictionary
2 arguments, IEnumerable& returnValue) in C:\Users\jeff.olmstead\EMS\src\Orchard\Events\DefaultOrchardEventBus.cs:line 68
at Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary`2 eventData, IEnumerable& returnValue) in C:\Users\jeff.olmstead\EMS\src\Orchard\Events\DefaultOrchardEventBus.cs:line 52

comments

jjthebig1 wrote Sep 10, 2012 at 9:12 PM

Thanks for the information and fix. I had this problem for a month now and couldn't track down the issue.