2014-09-05 45 views
4

我的MVC項目已在當我有它發表在網絡本地主機運行正常,我有這個錯誤,Castle.Core信任級別問題

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 Blog.Core.Bootstrapper.Start(Assembly[] assemblies) +130 Blog.MvcApplication.Application_Start() +970

我已閱讀this answer

我用這些指令重新編譯了Castle Project。我在我的項目中安全地刪除了Castle.Core.dll並添加了重新編譯的Castle.Core.dll。但我仍然有同樣的錯誤。

我該怎麼辦?我怎樣才能解決過去兩週一直在苦苦掙扎的這個問題?

+0

聽起來像一個IIS /反射問題給我。您需要充分信任地運行 – user3210546 2014-09-05 22:02:26

+0

@ user3210546是的,我需要但我的託管服務不允許,我應該找到一個解決方案。 – 2014-09-06 04:44:34

回答

0

用戶需要查找支持完全信任的託管提供商。大多數ASP.Net友好供應商都支持Full Trust,因爲現在沒有真正的理由不支持。

這很可能是您的問題的答案先生。

0

這可能是工作

<system.web> 
    <trust level="Full" /> 
</system.web> 

試穿的web.config中,歡呼聲