Orchard 1.3 on Azure

Topics: General, Installing Orchard
Nov 9, 2011 at 8:24 PM

We are having a lot of trouble getting Orchard to run on Azure.  Has anyone gotten this actually work?  We've tried building the solution from source control and downloading the 1.1 package.  Both end up giving the following exception.  Any help would be appreciated.

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'.

 

Source Error: 

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

 

Stack Trace: 

 

[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'.]

   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +578

   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +89

   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +122

   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +255

   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +246

   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +15

   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +74

   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +89

   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +141

   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +246

   Autofac.Core.Lifetime.LifetimeScope.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +276

   Autofac.ResolutionExtensions.Resolve(IComponentContext context, Service service, IEnumerable`1 parameters) +221

   Autofac.ResolutionExtensions.Resolve(IComponentContext context, IEnumerable`1 parameters) +117

   Orchard.Environment.ShellBuilders.ShellContextFactory.CreateSetupContext(ShellSettings settings) +1079

   Orchard.Environment.DefaultOrchardHost.CreateSetupContext() +223

   Orchard.Environment.DefaultOrchardHost.CreateAndActivateShells() +530

   Orchard.Environment.DefaultOrchardHost.BuildCurrent() +203

   Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() +80

   Orchard.Azure.Web.MvcApplication.Application_Start() in D:\EdaDev\products\catapult_prototype\website\WebRoles\Orchard.Azure.Web\Global.asax.cs:41

 

[HttpException (0x80004005): 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'.]

   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +4052053

   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191

   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352

   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407

   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375

 

[HttpException (0x80004005): 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'.]

   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11686928

   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141

   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4863749

 

 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

Coordinator
Nov 9, 2011 at 8:35 PM

Yes, I have several production sites running in Azure. Something seems to be half-built here.

Nov 9, 2011 at 8:40 PM

I'm starting from scratch again.  I'll use the Azure project and Azure tools 1.5.  I've also tried to push up the pre-compiled package which is from Orchard v1.1.  No joy.  I'll keep you posted.

Coordinator
Nov 9, 2011 at 8:42 PM

1.1? why?

Nov 9, 2011 at 11:03 PM

There was an existing pre-build package that said v1.1 on it so we tried it to ensure that it was not our build process.  Either way, I'm having trouble deploying with building the 1.39 version.

Coordinator
Nov 9, 2011 at 11:07 PM

And I suppose you made sure to follow exactly all the steps in the documentation?

Nov 9, 2011 at 11:23 PM

Here is what I've done.

  • Gotten the latest source code as a zip and unziped
  • Opened the Azure solution in VS2010 and converted the project.
  • Used the VS2010 IDE to build a package and specified the storage key from my Azure account.
  • Created a blank DB called orcharddb
  • Deployed the built package.
  • Go to the url
  • Get error. 

I'm still muddling through it.  I think the next step will be to try to build from ClickToBuildAzurePackage.cmd which is at http://www.orchardproject.net/docs/Deploying-Orchard-to-Windows-Azure.ashx

 

Coordinator
Nov 9, 2011 at 11:37 PM

The part I'm confused about: "converted the project". What do you mean by that?

Why aren't you building with ClickToBuildAzure.cmd like the documentation says?

Nov 10, 2011 at 12:02 AM

On converting - I thought VS2010 converted the project from VS2008.  My mistake.  Sorry for the confustion

On ClickToBuildAzure - I'm trying to do that now.  But, I think the real question is why do I need it? Shouldn't we be able to build, package, and deploy from VS2010?  We are trying to build a VS2010 solution that keeps from having to load all the source for each module (50+ projects).  When our solution didn't work, we decided to use the default azure solution.  However, that does't work either.

Net-Net - If get the default solution working we can get our modified solution working.  So, why do we have to use ClickToBuildAzure?

 

Nov 10, 2011 at 1:48 AM

Ok, I got the base product to work with ClickToBuildAzure.cmd.  I'll decompose the msbuild script to see why we can't build and deploy from VS2010.  Thanks for the help.

Coordinator
Nov 10, 2011 at 1:51 AM

Sure, let me know what you find.

Jan 12, 2012 at 5:32 PM

Hi SonnyPolaris,

Did you get to the bottom of this? I've tried the same process and I'm unable to get it to build.

Matthew

Coordinator
Jan 12, 2012 at 5:39 PM

@MatthewSteeples

Orchard 1.3 requires Azure SDK 1.5. Do you have this version installed ?

Jan 16, 2012 at 7:16 PM

@Sebastienros

Thanks for your reply. I've got 1.6 installed as that's the current version. I found that replacing all instances of 1.5 to 1.6 in the .proj file (in the root) allowed me to build and successfully deploy the solution.

Regards,
Matthew 

Jan 17, 2012 at 3:16 AM

In order to successfully build using the Deploying Azure documentation if you're using the Azure SDK 1.6 and current default branch (1.3.10), I had to swap 1.5 to 1.6 in the SDK paths here:

AzurePackage.proj (line 19)

src\Orchard.Azure.Tests\App.config (line 4) 

src\Orchard.Azure\Orchard.Azure.CloudService\Orchard.Azure.CloudService.ccproj (line 7 and 50)

then I guess the emulator location has changed so I had to hardcode the path to csrun.exe:

src\Orchard.Azure.Tests\AzureVirtualEnvironmentTest.cs (change line 21 t0)

                        "C:\\Program Files\\Windows Azure Emulator\\emulator\\csrun.exe"