None of the constructors found with 'Public binding flags' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters

I am trying to set up an Orchard site on a shared hosting environment. I made sure the site ran locally, but I didn't configure it yet. I made sure it could get me to the setup screen.

I then pushed the site out to the shared hosting using FTP and tried to access the site. When I navigate there, I am getting the following exception instead of the setup screen.

Server Error in '/' Application.

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

This might means that you pushed too much dlls which are not needed, and Orchard thinks it's already fully compiled. You should use WebMAtrix starting from a Orchard.Web isntall, not the source code. Otherwise can you describe what you downloaded and how
you are working with it ?

I used the Web Platform Installer to set up a WebMatrix site, which I then deployed using FTP to my host.

That's literally all I did to get this issue.

However, I've actually just gotten the site running. I asked the hosting company to assist and they said they grabbed the compiled download from the site and not from the Web Platform Installer, and it seems to have worked correctly. I was under the impression
that these were the same files, so I don't know why it's working now.

I had tried uploading the files a few times and from different computers, so I am not sure what could have been the issue.

The error is a result of modules loaded by the DynamicExtensionLoader rather than with the PrecompiledExtensionLoader.

A new installation using ftp will timestamp the .csproj files later than the .dll files in each of the module directories due of the order of copying the files where a local file copy will preserve the dates and times.

The former forces the DynamicExtensionLoader to be used and the latter the PrecompiledExtensionLoader - and the bad news is it appears that modules loaded by DynamicExtensionLoader no longer function at all in Orchard 1.4.1.

The Stack Trace above is the result of Orchard.Setup loaded by the DynamicExtensionLoader - other modules may not be so obvious to detect, from missing in admin menu to missing routes generating NOT FOUND errors, although under Full Trust in Modules
Admin there is a missing reference warning but not under Medium Trust.

Results of testing modules loaded with DynamicExtensionLoader:

Orchard

Autofac

Full Trust

Medium Trust

1.3.10

2.2.4.900

OK

OK

1.4

2.5.2.830

OK

X

1.4.1

2.6.1.841

X

X

To reproduce locally error create a new site from a file copy and update the Orchard.Setup.csproj to force DynamicExtensionLoader to load module - browse your site in expectation of the Setup page - result error and Stack Trace.

Note for version 1.4 only occurs at Medium Trust setting and not at all for earlier versions - the load method for the Setup module can be verified from the App_Data/Dependencies/dependencies.xml file.

@filetek What is the solution? I have the same problem on shared hosting

Server Error in '/' Application.

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

Via ftp re-copy the bin directory for each of the Modules, /Modules/Orchard.Setup/bin, etc - the timestamp for the .dlls should now be later than the .csproj files you previously copied.

If you have not set up Orchard you can delete the contents of App_Data and restart the application - re-copy Web.config and Global.asax.

When you browse your site you should eventually get the Setup page once Orchard has copied and loaded all the modules - you can verify the way Orchard loaded the modules from the file /App_Data/Dependencies/dependencies.xml - the LoaderName for each module
should be PrecompiledExtensionLoader and the .dll present in /App_Data/Dependencies.

I'm running into this error on a new install (extracted files from the Orchard.Web.1.4.2.zip file). I've tried about everything I can think of to get by it and everything in this post with no luck. Any help would be appreciated. A Lot.

Adrian

***UPDATE***

Our environment runs off two load balanced servers. The site in question is running fine on one server but not the other. The only thing I can think of is some sort of permission difference that I can't find.

***LAST UPDATE***

My problem was I forgot that the replication between the servers ignores txt files. (kind of need them). #ImAmoron

But when I click Run in the WebMatrix window, the browser displays this error:

Server Error in '/' Application.
--------------------------------------------------------------------------------
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.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, 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.

I don't know how to resolve this error. I welcome any suggestions, thank you!

I got the same error message. I used WebMatrix (v1) to create a new site from webgallery, chose 'Orchard CMS' (of course!) and after completion the error shows up. I resolved it by stopping the site and deleted the 'Dependencies' folder inside the App_Data
folder. Then started the site again and it worked fine.

Today is 2013 now, I still meet the same problem.
I have to package the files to a zip file and upload to ftp, then I developed a simple web application which can unzip it, then everything works.
If anyone need my unzip tool, please contact me.

I had several problems deploying Orchard to Azure and got so tired of it that I moved to Wordpress. After strugling with Orchard for days and days, it took me literaly 15 mins. to get my blog up and running. I any one is is in the position to move or start
with Wordpress I would strongly advise to do so.

Stephan, I'm sorry you hit difficulties, and hope WordPress works well for you. It's a great and mature blogging platform. It would be nice if you could share what those difficulties were however, so we can improve our user experience.

I wasn't able to deploy orchard on Azure, I hit the problems discussed in the thread and wasn't able to solve them. At that time, WordPress on Azure also became available and it was just so much easier setting it up I switched to it.

To add to this, I also have spent days and days trying to get Orchard running on Azure.

I had no azure tools installed locally before I started, and downloaded the latest version - 2.1. I think this may be the start of my problems.

First of all I was getting "Could not load Microsoft.WindowsAzure.ServiceRuntime - no file could be found"
I switched it to "copy local" and tried again
Next I got "Could not load Microsoft.WindowsAzure.ServiceRuntime - version number doesn't match manifest" or something similar.
I added a redirect into the web.config, redirecting versions 1.7 and 1.8 to newVersion 2.1.
Next I got the message which is the title of this thread.....No idea how to diagnose the problem now, though.

I'm using VS2012 with a vanilla Orchard 1.7.1 source-code drop. I'm deploying from my local machine using VS2012 Publish in the "Cloud Service" project.