Error in custom module occurs randomly

Topics: Core
Mar 5, 2015 at 4:18 AM
Edited Mar 5, 2015 at 4:19 AM
I built a module that creates a new notify system that allows for specifying the zone the content is placed in. This worked fine on the instances of Orchard I was testing on but when I went to put it on a version of Orchard on our server it blew up. I'm wondering if it may be because the ExtendedWorkflows module which has the new activity which uses the new notify system and was already enabled now depends on the CustomNotification module which hasn't been enabled. Otherwise I don't know what the problem could be. Here is the error I received:

None of the constructors found with 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Orchard.ExtendedWorkflows.Activities.CustomNotificationActivity' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.CustomNotifier.ICustomNotifier notifier' of constructor 'Void .ctor(Orchard.CustomNotifier.ICustomNotifier)'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Autofac.Core.DependencyResolutionException: None of the constructors found with 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Orchard.ExtendedWorkflows.Activities.CustomNotificationActivity' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.CustomNotifier.ICustomNotifier notifier' of constructor 'Void .ctor(Orchard.CustomNotifier.ICustomNotifier)'.

Source Error:


Line 22: <meta charset="utf-8" />
Line 23: <title>@Html.Title(title, siteName)</title>
Line 24: @Display(Model.Head) __* This line was highlighted as causing the error__
Line 25: <script> (function (d) { d.className = "dyn" + d.className.substring(6, d.className.length); })(document.documentElement);</script>
Line 26:

Source File: e:\Sites\Orchard.testsite.com\Themes\customtheme\Views\Document.cshtml Line: 24

__*This theme was based off of an older version of Orchard's TheThemeMachine which may be the problem as I didn't receive this error while testing on versions of Orchard using the latest TheThemeMachine__

Thank you.
Mar 5, 2015 at 4:11 PM
The exception says that AutoFac cannot build your implementation of ICustomNotifier (with default ctor) which is needed in CustomNotificationActivity. Can you check that you have a implementation of ICustomNotifier and it implements the IDependency?

But it is wired that it works local. Are you sure all of your modules on the server are on the same version as local?
Marked as answer by emeraldarcher on 3/5/2015 at 6:06 PM
Mar 6, 2015 at 2:06 AM
I believe the problem was the fact the workflows module was enabled before the custom notifier module.