Running Orchard on Windows Shared Hosting

Topics: Administration
Apr 1, 2013 at 12:56 AM
__I'm running into problems when viewing my website. The following error is generated:

_Server Error in '/' Application.

Inheritance security rules violated while overriding member: 'log4net.Util.ReadOnlyPropertiesDictionary.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
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:



[TypeLoadException: Inheritance security rules violated while overriding member: 'log4net.Util.ReadOnlyPropertiesDictionary.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.]
log4net.Repository.Hierarchy.Hierarchy..ctor(ILoggerFactory loggerFactory) +0
log4net.Repository.Hierarchy.Hierarchy..ctor() +22

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
System.Activator.CreateInstance(Type type) +6
log4net.Core.DefaultRepositorySelector.CreateRepository(String repositoryName, Type repositoryType) +513
log4net.Core.DefaultRepositorySelector.CreateRepository(Assembly repositoryAssembly, Type repositoryType, String repositoryName, Boolean readAssemblyAttributes) +465
log4net.Core.DefaultRepositorySelector.CreateRepository(Assembly repositoryAssembly, Type repositoryType) +17
log4net.Core.DefaultRepositorySelector.GetRepository(Assembly repositoryAssembly) +42
log4net.Core.LoggerManager.GetLogger(Assembly repositoryAssembly, String name) +55
log4net.LogManager.GetLogger(Assembly repositoryAssembly, String name) +8
log4net.LogManager.GetLogger(String name) +20
Orchard.Logging.OrchardLog4netFactory.Create(String name) in OrchardLog4netFactory.cs:28
Castle.Core.Logging.AbstractLoggerFactory.Create(Type type) +31
Orchard.Logging.CastleLoggerFactory.CreateLogger(Type type) in CastleLoggerFactory.cs:12
Orchard.Logging.LoggingModule.CreateLogger(IComponentContext context, IEnumerable1 parameters) in LoggingModule.cs:75
Autofac.Builder.<>c__DisplayClass1
1.<ForDelegate>b__0(IComponentContext c, IEnumerable1 p) +14
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters) +30
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) +48
Autofac.Core.Resolving.InstanceLookup.Execute() +48
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters) +167
Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters) +24
Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1 parameters, Object& instance) +70
Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) +54
Autofac.ResolutionExtensions.Resolve(IComponentContext context, IEnumerable
1 parameters) +118
Orchard.Logging.<>c__DisplayClass11.<BuildLoggerInjectors>b__8(String key) in LoggingModule.cs:65
System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) +72
Orchard.Logging.<>c__DisplayClassf.<BuildLoggerInjectors>b__7(IComponentContext ctx, Object instance) in LoggingModule.cs:65
Orchard.Logging.<>c__DisplayClass1.<AttachToComponentRegistration>b__0(Object s, ActivatedEventArgs1 e) in LoggingModule.cs:40
Autofac.Core.Registration.ComponentRegistration.RaiseActivated(IComponentContext context, IEnumerable
1 parameters, Object instance) +70
Autofac.Core.Resolving.InstanceLookup.Complete() +77
Autofac.Core.Resolving.ResolveOperation.CompleteActivations() +104
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) +207
Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable
1 parameters) +44

[DependencyResolutionException: An exception was thrown while executing a resolve operation. See the InnerException for details.]
Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable1 parameters) +112
Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable
1 parameters) +164
Autofac.Core.Container.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters) +14
Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1 parameters, Object& instance) +70
Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) +54
Autofac.ResolutionExtensions.Resolve(IComponentContext context, IEnumerable
1 parameters) +118
Autofac.ResolutionExtensions.Resolve(IComponentContext context) +75
Orchard.Environment.OrchardStarter.CreateHostContainer(Action1 registrations) in OrchardStarter.cs:132
Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in Global.asax.cs:46
Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in Starter.cs:89

[ApplicationException: Error during application initialization]
Orchard.WarmupStarter.Starter
1.OnBeginRequest(HttpApplication application) in Starter.cs:63
Orchard.Web.MvcApplication.Application_BeginRequest() in Global.asax.cs:29

[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) +192
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +108
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +56
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69


I'm using Orchard version 1.6 What changes do I need to make?_
Coordinator
Apr 1, 2013 at 2:48 AM
Almost looks like your hosting company has a version of log4net in the gac that is different from the one Orchard is using.
Apr 1, 2013 at 11:55 AM
__If that's the case, I'm assuming that Orchard is not designed to run on Windows shared hosting but only on Windows Azure, is that a correct assumption? My Windows shared hosting is on a Windows server 2008 R2 running ASP.Net. I doubt that I can get the hosting company to make changes to the GAC since it's shared.

Is there anyone in this forum that might be running Orchard on a shared hosting package?__
Apr 1, 2013 at 5:20 PM
I have 5 websites running in a very cheap shared hosting environment and have no problem. You should present to your hosting provider what Bertrand stated above or just go for another hosting company.
Apr 2, 2013 at 1:50 PM
____Thank you Bertrand and nduarte! My web hosting provider does not support Orchard CMS so I uploaded to Windows Azure.

I do have a question about Azure tho, how do I enable write permissions for the theme folder or theme in Orchard.? Also any other folder. Do I use ACS?____
Coordinator
Apr 5, 2013 at 7:44 AM
Your assertion above is entirely incorrect by the way. I'm running Orchard on shared hosting.

You should not install themes (or modules) from your Azure instance. Install them on your dev machine and then deploy to Azure.