Publishing/deploying my website

Topics: General
Sep 6, 2013 at 11:37 AM
Hello everyone,

after finishing my website I used the "Publish" button in Visual Studio 2012. Everything went fine, I published it via "File system" and I got a package of files. Then I load those files on a testing server and after running the website I get this error:

Server Error in '/' Application.

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --> <configuration>
<system.web>
    <customErrors mode="Off"/>
</system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --> <configuration>
<system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>

As usuall I would be more than thankfull for any kind of help
Coordinator
Sep 7, 2013 at 5:38 AM
You should start by setting custom errors to off, in order to get a proper error message.
Sep 9, 2013 at 7:35 AM
Ok I set the errors to off and this is what i got:

Server Error in '/' Application.

Access to the path 'C:\inetpub\wwwroot\App_Data\Dependencies\dependencies.xml' is denied.

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: System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\App_Data\Dependencies\dependencies.xml' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

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:


[UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\App_Data\Dependencies\dependencies.xml' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +216
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1430
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +208
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) +90
Orchard.FileSystems.AppData.AppDataFolder.CreateFile(String path) in c:\Users\Maciej\Downloads\Orchard\src\Orchard\FileSystems\AppData\AppDataFolder.cs:122
Orchard.FileSystems.Dependencies.DefaultDependenciesFolder.WriteDependencies(String persistancePath, IEnumerable1 dependencies) in c:\Users\Maciej\Downloads\Orchard\src\Orchard\FileSystems\Dependencies\DefaultDependenciesFolder.cs:98
Orchard.Environment.Extensions.ExtensionLoaderCoordinator.SetupExtensions() in c:\Users\Maciej\Downloads\Orchard\src\Orchard\Environment\Extensions\ExtensionLoaderCoordinator.cs:78
Orchard.Environment.DefaultOrchardHost.BuildCurrent() in c:\Users\Maciej\Downloads\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:101
Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() in c:\Users\Maciej\Downloads\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:68
Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in c:\Users\Maciej\Downloads\Orchard\src\Orchard.Web\Global.asax.cs:51
Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in c:\Users\Maciej\Downloads\Orchard\src\Orchard.WarmupStarter\Starter.cs:89

[ApplicationException: Error during application initialization]
Orchard.WarmupStarter.Starter
1.OnBeginRequest(HttpApplication application) in c:\Users\Maciej\Downloads\Orchard\src\Orchard.WarmupStarter\Starter.cs:63

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +229
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +193
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +74
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18010
Coordinator
Sep 9, 2013 at 7:47 AM
Well, that's what your problem is. You need read/write access for the IIS process to app_data.
Sep 9, 2013 at 7:51 AM
Ok and how do I give the read/write access to the app_data ??
Coordinator
Sep 9, 2013 at 7:51 AM
I don't know. Depends where it's hosted. Ask your hosting company.
Sep 9, 2013 at 7:55 AM
Edited Sep 9, 2013 at 8:02 AM
It's on a local testing server in the company I'm currently having an internship in ... so basicly the admin has to give the read/write possibility to the whole app_data folder if I understand it correctly ??

And one more question: is it normal that I had to copy the app_data folder into the webserver manually ??
Coordinator
Sep 10, 2013 at 2:40 AM
Yes, they need to give read/write permissions to app_data. You will also need read/write access to Media, and also Modules and Themes if you are going to install themes and modules from the dashboard.
Whether it's normal that you had to copy app_data depends on your configuration, of which I know too little.
Sep 10, 2013 at 8:12 AM
Well the admin gave the access to all the folders and still for a very long time Orchard was telling that the access was missing (which was btw very strange). After that he managed to finally stop the showing of this missing accsess error and he got an Orchard 404 error.

We also tried to install Orchard on the webserver directly but then we got an error that Orchard is missing the connection string to the database (which was wierd because during the installation I told that I want to use the build in database). Even after I copied the Settings.txt file it still was showing an error.
Coordinator
Sep 10, 2013 at 7:44 PM
What do you have in app_data\logs?
Sep 10, 2013 at 8:43 PM
A few error txt files but they are all empty
Coordinator
Sep 10, 2013 at 8:45 PM
So where are you at now?
Sep 11, 2013 at 8:32 AM
Well I tried pretty much everything I could:
  1. Publishing from Visual Studio
  2. Copy the whole source files to the webserver and trying to install Orchard
  3. Copy only the Orchard (only the install folder, not the source one) folder and trying to install it directly on the webserver
RESULT:
  • still get the access denied error
  • at some point I managed to get the install page from Orchard with the admin, database etc. but after that I got an error saying that I miss the conection string in the settings file ... which is strange because I used the built in database
So I'm standing in place. ... But one question still bothers me: does the version of Orchard have anything to do with these installation problems ?? Because I'm working on the 1.6 version.
Coordinator
Sep 11, 2013 at 7:31 PM
If you still get access denied, it means that you still don't have the right permissions on the folder.
Sep 12, 2013 at 8:01 AM
That's impossible because we've checked every single folder and file and everything had access to basicly everything.
Sep 13, 2013 at 8:25 AM
I'm sorry for the double post but after some work with Orchard on the Webserver this time I got an error like this:

Server Error in '/' Application.

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.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)'.
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.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 '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.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)'.]
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters) in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Activators\Reflection\ReflectionActivator.cs:106
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Resolving\InstanceLookup.cs:79
Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func
1 creator) in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Lifetime\LifetimeScope.cs:270
Autofac.Core.Resolving.InstanceLookup.Execute() in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Resolving\InstanceLookup.cs:64
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Resolving\ResolveOperation.cs:123
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters) in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Activators\Delegate\DelegateActivator.cs:69
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Resolving\InstanceLookup.cs:79
Autofac.Core.Resolving.InstanceLookup.Execute() in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Resolving\InstanceLookup.cs:62
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters) in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Resolving\ResolveOperation.cs:123
Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable1 parameters) in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Resolving\ResolveOperation.cs:94
Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable
1 parameters) in c:\Projects\OSS\autofac\Core\Source\Autofac\Core\Lifetime\LifetimeScope.cs:232
Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) in c:\Projects\OSS\autofac\Core\Source\Autofac\ResolutionExtensions.cs:346
Autofac.ResolutionExtensions.Resolve(IComponentContext context, IEnumerable
1 parameters) in c:\Projects\OSS\autofac\Core\Source\Autofac\ResolutionExtensions.cs:197
Orchard.Environment.ShellBuilders.ShellContextFactory.CreateSetupContext(ShellSettings settings) in c:\Orchard\src\Orchard\Environment\ShellBuilders\ShellContextFactory.cs:113
Orchard.Environment.DefaultOrchardHost.CreateAndActivateShells() in c:\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:145
Orchard.Environment.DefaultOrchardHost.BuildCurrent() in c:\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:104
Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() in c:\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:68
Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in c:\Orchard\src\Orchard.Web\Global.asax.cs:51
Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in c:\Orchard\src\Orchard.WarmupStarter\Starter.cs:89

[ApplicationException: Error during application initialization]
Orchard.WarmupStarter.Starter`1.OnBeginRequest(HttpApplication application) in c:\Orchard\src\Orchard.WarmupStarter\Starter.cs:63

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +229
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +193
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +74
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165

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

Has someone got any ideas what Orchard wants this time ??