Orchard.Exceptions.DefaultExceptionPolicy - Object does not match target type.

Topics: Core, Troubleshooting, Writing modules
Aug 22, 2012 at 3:39 AM

My logs are filled with this error but without any other details. Where can I find the module/code causing this?

I also noticed my Lucene module is installed but it's not generating an index, neither is it showing up in the Admin/Settings menu.

Coordinator
Aug 22, 2012 at 5:24 AM

Logs also contain stack traces.

Aug 22, 2012 at 5:47 AM

But not on this one. It has no other details.

On Aug 22, 2012 12:24 AM, "bertrandleroy" <notifications@codeplex.com> wrote:

From: bertrandleroy

Logs also contain stack traces.

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Coordinator
Aug 22, 2012 at 6:56 AM

That's extremely weird. Attach a debugger and break on that specific exception.

Aug 29, 2012 at 7:35 PM

Bertrand, I updated the site to 1.5.1 and now I'm getting more details.

2012-08-29 14:30:40,683 [13] 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 Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in c:\Build\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:line 84
   at Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String interfaceName, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in c:\Build\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:line 73
   at Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary`2 eventData, IEnumerable& returnValue) in c:\Build\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:line 52

Aug 29, 2012 at 9:42 PM

Update:

I haven't fixed the above issue but I found the problem that prevented Lucene from loading. After attaching to the process, this error "error CS0579: Duplicate 'SecurityRules' attribute" popped up a few times. Removing the "[assembly:SecurityRules(SecurityRuleSet.Level2)]" line from all modules fixed this error and Lucene finally indexed all pages.

Sep 10, 2012 at 10:14 PM

Bertrand,

Thanks for your help at the conference. I found the issue and a fix here: http://orchardaudit.codeplex.com/workitem/2

- Jacob