Problem building Orchard Project

Topics: General, Localization, Troubleshooting
Jul 26, 2013 at 7:29 PM
Hi all,

I've downloaded the Orchard 1.7 source from CodePlex and used this as my project source. I've created a site, added some modules and now I want to deploy it to my webserver.

I'm getting an error which says:
 None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' 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.Owned`1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable`1[Orchard.Mvc.Routes.IRouteProvider], System.Collections.Generic.IEnumerable`1[Orchard.WebApi.Routes.IHttpRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable`1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.
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 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' 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.Owned`1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable`1[Orchard.Mvc.Routes.IRouteProvider], System.Collections.Generic.IEnumerable`1[Orchard.WebApi.Routes.IHttpRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable`1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.
Not sure what this means?
I also tried a 'Publish' when right-clicking on the Orchard.Web project, but that doesn't publish a working site either.

I actually want to run it on Azure in the end, but since I see so much different implementations of it around the internet, I'm wondering what is the right one.

Anyway, I assume that the 'build PreCompiled' command should have worked. Also the 'ClickToBuild' command generates the same error.

Any help is appreciated.

Thanks,
Daniel
Jul 26, 2013 at 7:46 PM
Of course, a fresh downloaded copy from the Orchard 1.7 bits, without opening in VS, has a succesfull build and generates a /PreCompiled folder which runs perfect!
Now that is great :)

I did nothing special with my project. I use a SQL Server database, and only created a Theme, installed the Combinator module and enabled the Custom Forms module.
So I don't know what that is different for not building the project.

-Daniel
Coordinator
Jul 26, 2013 at 9:12 PM
Please check that the server runs the site at the root of an application that is in an app pool that is in integrated mode, running .NET 4.0 or 4.5.
Jul 26, 2013 at 10:46 PM
Hi Bertrand,

Thanks. Both sites are running the same way:
  • Virtual directory inside IIS
  • App pool (32 bit) in integrated mode
I read somewhere that you wrote you can also Publish the Orchard.Web application from VS.
Do I need to include some hidden directories then, or should it just work? For example: there is no /bin folder when that process has ended...

-Daniel
Coordinator
Jul 27, 2013 at 12:27 AM
No bin folder would explain it. You have an incomplete deployment. Please consult the documentation http://docs.orchardproject.net/Documentation/Building-and-deploying-Orchard-from-a-source-code-drop
Jul 27, 2013 at 9:02 AM
That's what I was saying. I followed these instructions. A fresh build runs okay, my modified website not.
Coordinator
Jul 27, 2013 at 9:19 AM
Are you saying that a build precompiled command gives you a package that doesn't have the binaries?
Jul 27, 2013 at 9:29 AM
No, that one actually runs with 2 warnings. The 'right-click-and-publish' command on my Orchard.Web project gives me the package without the /bin folder.
Coordinator
Jul 27, 2013 at 10:58 PM
Try to deploy what's in \build\Precompiled after the build Precompiled. There should definitely be a non-empty bin forlder in there.
Jul 29, 2013 at 9:36 AM
I had to change the Orchard.proj file to remove the reference to the OrchardLogo.png, since I had removed it from my project. It was an error that was shown half down the build process.

Apparently it isn't possible to have a successful build when missing some images.

Anyway, after resolving this issue, it did a successful build and the /PreCompiled directory was created. And after manually copying the App_Data/Sites folder, it run my site as expected.

Thanks,
Daniel