Azure Cloud Deployement

Topics: Administration, Core, Francais (French), General, Installing Orchard, Writing modules
May 15, 2013 at 10:59 AM
Hello,
I try to deploy Orchard on Windows Azure but it works on the Azure emulator and not on the Azure Cloud. I wanted to know if you have a solution to the error or a link that can help me?

thank you

this is my error :

Exception Details: Autofac.Core.DependencyResolutionException: None of the constructors found with 'Public binding flags' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher' of constructor 'Void .ctor(System.Func1[Autofac.Features.OwnedInstances.Owned1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable1[Orchard.Mvc.Routes.IRouteProvider], System.Collections.Generic.IEnumerable1[Orchard.WebApi.Routes.IHttpRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.

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 'Public binding flags' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher' of constructor 'Void .ctor(System.Func
1[Autofac.Features.OwnedInstances.Owned1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable1[Orchard.Mvc.Routes.IRouteProvider], System.Collections.Generic.IEnumerable1[Orchard.WebApi.Routes.IHttpRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.]
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) +463
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters) +89
Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func1 creator) +122
Autofac.Core.Resolving.InstanceLookup.Execute() +164
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters) +206
Autofac.Builder.<>c__DisplayClass11.<ForDelegate>b__0(IComponentContext c, IEnumerable1 p) +15
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) +30
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters) +89
Autofac.Core.Resolving.InstanceLookup.Execute() +181
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) +206
Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable
1 parameters) +193
Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters) +193
Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable
1 parameters) +168
Autofac.ResolutionExtensions.Resolve(IComponentContext context, IEnumerable1 parameters) +117
Orchard.Environment.ShellBuilders.ShellContextFactory.CreateSetupContext(ShellSettings settings) +511
Orchard.Environment.DefaultOrchardHost.CreateAndActivateShells() +370
Orchard.Environment.DefaultOrchardHost.BuildCurrent() +195
Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() +105

[HttpException (0x80004005): None of the constructors found with 'Public binding flags' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher' of constructor 'Void .ctor(System.Func
1[Autofac.Features.OwnedInstances.Owned1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable1[Orchard.Mvc.Routes.IRouteProvider], System.Collections.Generic.IEnumerable1[Orchard.WebApi.Routes.IHttpRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +4057733
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 'Public binding flags' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher' of constructor 'Void .ctor(System.Func1[Autofac.Features.OwnedInstances.Owned1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable1[Orchard.Mvc.Routes.IRouteProvider], System.Collections.Generic.IEnumerable1[Orchard.WebApi.Routes.IHttpRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable`1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11702064
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4870277

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.276
May 15, 2013 at 1:12 PM
Edited May 15, 2013 at 1:16 PM
It looks like you are missing some dlls on azure. These errors in particular suggest Orchard.Framework

How are you publishing your site to Azure currently?
May 15, 2013 at 2:10 PM
i build the cloudservice with ClickToBuildAzurePackage.cmd and after this in Visual Studio 10 i create the package to publish in the cloud
May 17, 2013 at 11:03 AM
Edited May 17, 2013 at 12:04 PM
I haven't deployed like that for over a year (moved onto the azure web site preview stuff) so hopefully someone else can give some advice.

I presume that no errors are occurring during the ClickToBuildAzurePackage process. When warnings occur it will complete its work but when there are errors it will just give up.
May 17, 2013 at 12:52 PM
Edited May 17, 2013 at 12:53 PM
I had some warnings during the ClickToBuildAzurePackage process to fix them i downloaded the 1.7 azure sdk
May 17, 2013 at 1:17 PM
Gwena wrote:
I had some warnings during the ClickToBuildAzurePackage process to fix them i downloaded the 1.7 azure sdk
If no one else gets the chance i will try this out this evening or over the weekend. I accidentally updated my main azure solution to version 2.0 of the azure sdk (though it was asking for 1.8) so I couldnt test it out yesterday.

Question in the mean time:
Are you using the vanilla version of the source 1.6 or 1.6.1 or is your code from a branch?
May 17, 2013 at 3:33 PM
I use the source 1.6.1 and my sdk is 1.7
May 18, 2013 at 4:51 PM
Edited May 18, 2013 at 4:57 PM
Excellent.

Ive created a new site with the cloudapp service using 1.6.1 straight from here and all went fine once I had worked out where everything was on azure again. I have a feeling that creating the package directly from Visual Studio is your problem and it doesnt have enough targets to tell it to compile and deploy the modules, core and themes to the package.

I Had to get the sdk first. Opened Orchard.Azure.sln in VS2012 and it noticed the 1.7 bindings and directed web download tools to fetch the related modules. Easy and fantastic. Dont update to version 2.0 as it will break :D
  1. Created a new storage area. (needed for the config file - account key and name)
  2. Created a new service.
  3. Already have a database there <- i'll use that.
  4. Ran the click to build (ClickToBuildAzurePackage.cmd)
...
Package-Zip:
  Creating directory "E:\Tests\Orchard.Source.1.6.1\artifacts\Azure".
  Creating zip file "E:\Tests\Orchard.Source.1.6.1\artifacts\Azure\AzurePackage.zip".
    added "ServiceConfiguration.cscfg".
    added "Orchard.Azure.Web.cspkg".
  Created zip file "E:\Tests\Orchard.Source.1.6.1\artifacts\Azure\AzurePackage.zip" successfully.
Done Building Project "E:\Tests\Orchard.Source.1.6.1\AzurePackage.proj" (Build target(s)).

Build succeeded.
  1. Followed the path here: E:\Tests\Orchard.Source.1.6.1\artifacts\Azure\AzurePackage.zip
  2. Extracted the zip file.
  3. Updated the config file as follows
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="OrchardCloudService" osFamily="1" osVersion="*" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" schemaVersion="2012-05.1.7">
  <Role name="Orchard.Azure.Web">
    <Instances count="1" />
    <ConfigurationSettings>
      <Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https;AccountName={my account name of the azure storage};AccountKey=X+CPV7nTQy3roRu67YqvvkmyAqCeTJOhYm6rDj4jEpPtJoIAKr6oR5wxAP9SiKeOAyLT9AewEZbs4jjuy4JGNA==" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
    </ConfigurationSettings>
  </Role>
</ServiceConfiguration>
by the way that's not my account key ;)
  1. Use azure to deploy the updated config and package.
Follow the rest of these tutorials for more information on including more modules and themes.
May 20, 2013 at 8:50 AM
thanks it works but when i build the package with VS 2010 it doesn't work