I've deployed a asp.net mvc 3 project wich use castle.core & windsor, but running on my hosting (in shared hosting) I got this: Inheritance security rules violated while overriding member: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
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.TypeLoadException: Inheritance security rules violated while overriding member: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. 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: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.] Castle.Windsor.WindsorContainer..ctor() +0 MyProj.Framework.Web.Core.App_Start.Bootstrapper.InitializeIoC() in PreApplicationStart.cs:98 MyProj.Framework.Web.Core.App_Start.Bootstrapper.PreApplicationStart() in PreApplicationStart.cs:70
[InvalidOperationException: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090876 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
On Wednesday, October 17, 2012 11:32:29 AM UTC+2, aozora wrote:
> I've deployed a asp.net mvc 3 project wich use castle.core & windsor, but > running on my hosting (in shared hosting) I got this: > Inheritance security rules violated while overriding member: > 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security > accessibility of the overriding method must match the security > accessibility of the method being overriden.
> 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.TypeLoadException: Inheritance security rules > violated while overriding member: > 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. 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: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. > Security accessibility of the overriding method must match the security > accessibility of the method being overriden.] > Castle.Windsor.WindsorContainer..ctor() +0 > MyProj.Framework.Web.Core.App_Start.Bootstrapper.InitializeIoC() in > PreApplicationStart.cs:98 > MyProj.Framework.Web.Core.App_Start.Bootstrapper.PreApplicationStart() > in PreApplicationStart.cs:70
> [InvalidOperationException: The pre-application start initialization > method Run on type WebActivator.ActivationManager threw an exception with > the following error message: Exception has been thrown by the target of an > invocation..]
> [HttpException (0x80004005): The pre-application start initialization > method Run on type WebActivator.ActivationManager threw an exception with > the following error message: Exception has been thrown by the target of an > invocation..] > System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090876 > System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
I'm seeing this same issue on a project built with Sharp Architecture which uses Castle and NHibernate. It looks like I'm chasing through the same hoops you are. I found this thread to have some direction, but I'm not sure how to actually apply this info. http://social.msdn.microsoft.com/Forums/en-US/netfxgeneralprerelease/...
The error seems to indicate that some virtual method override is causing a security level change from the original implementation of the method. I had read a post that indicated this might be due to the castle proxy implementation or have something to do with needing to enable lazy loading on all entity classes. I'm still not sure if either of those solutions are correct, or how to implement them, but I'll post if I find something.
On Wednesday, October 17, 2012 4:32:29 AM UTC-5, aozora wrote:
> I've deployed a asp.net mvc 3 project wich use castle.core & windsor, but > running on my hosting (in shared hosting) I got this: > Inheritance security rules violated while overriding member: > 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security > accessibility of the overriding method must match the security > accessibility of the method being overriden.
> 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.TypeLoadException: Inheritance security rules > violated while overriding member: > 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. 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: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. > Security accessibility of the overriding method must match the security > accessibility of the method being overriden.] > Castle.Windsor.WindsorContainer..ctor() +0 > MyProj.Framework.Web.Core.App_Start.Bootstrapper.InitializeIoC() in > PreApplicationStart.cs:98 > MyProj.Framework.Web.Core.App_Start.Bootstrapper.PreApplicationStart() > in PreApplicationStart.cs:70
> [InvalidOperationException: The pre-application start initialization > method Run on type WebActivator.ActivationManager threw an exception with > the following error message: Exception has been thrown by the target of an > invocation..]
> [HttpException (0x80004005): The pre-application start initialization > method Run on type WebActivator.ActivationManager threw an exception with > the following error message: Exception has been thrown by the target of an > invocation..] > System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090876 > System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97