Orchard in Azure : Error on Load

Topics: Installing Orchard
May 12, 2011 at 10:58 PM

Site works on local development Azure.

Site gives this error in production Azure.

 

Server Error in '/' Application.


None of the constructors found with policy 'Autofac.Core.Activators.Reflection.BindingFlagsConstructorFinder' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters:
Constructor 'Void .ctor(System.Func`1[Autofac.Features.OwnedInstances.Owned`1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable`1[Orchard.Mvc.Routes.IRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable`1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher)' parameter resolution failed at parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher'.

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 policy 'Autofac.Core.Activators.Reflection.BindingFlagsConstructorFinder' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters:
Constructor 'Void .ctor(System.Func`1[Autofac.Features.OwnedInstances.Owned`1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable`1[Orchard.Mvc.Routes.IRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable`1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher)' parameter resolution failed at parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher'.

 

Coordinator
May 12, 2011 at 11:40 PM

You might need to restard your Azure instance. We have seen this happening sometimes before. We can't explain why for the moment.

May 13, 2011 at 3:56 PM

While trying to figure out what's wrong we've pushed at least 10 different versions up. I assume when you upgrade the instance it tears it down and restarts it right?

Coordinator
May 13, 2011 at 4:27 PM

Yes and no. You are restarting on a fresh update, so it's different that doing a pure restart. Can you do it to test ?

May 13, 2011 at 4:35 PM

Restart issued by an update and a pure restart are different?

I forced the instance to restart - same error.

May 17, 2011 at 3:26 PM

I have the same error, actually the policy is different, but I think the issue is the same.

This error does not occur when using the package provided on codeplex.

None of the constructors found with policy 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Orchard.Settings.CurrentSiteWorkContext' can be invoked with the available services and parameters:
Constructor 'Void .ctor(Orchard.Settings.ISiteService)' parameter resolution failed at parameter 'Orchard.Settings.ISiteService siteService'.

May 17, 2011 at 6:15 PM

This problem was cause by us trying to make the azure package ourselves.

After looking into the AzurePackage.proj I noticed that there were some "manual" steps that are taking place to make the package valid.

Inside <Target Name="Package-ForCloud"> the Themes/Core/Modules are being moved over before CSPack is called.

After replicating ALL the targets in our build activity the code deploys to azure successfully.

May 17, 2011 at 6:15 PM

Running ClickToBuildAzurePackage.cmd by hand on our build server also output a successful package.

May 17, 2011 at 6:43 PM

Cool. Since I downloaded the zip containing the source, this cmd wasn't there. Now I enlisted the source code and the file is there ;-)