在 Windows 共享主机上以中等信任级别运行 ASP.NET 的 SecurityException

本文关键字:运行 ASP NET SecurityException 信任 共享 Windows 主机 | 更新日期: 2023-09-27 18:37:00

我有一个 ASP.NET Web 表单应用程序,它在本地运行良好,当我将其部署到 hostgator Windows 共享帐户上时,它给出以下错误: 错误链接

[安全例外:该程序集不允许部分受信任的调用方。 Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory..cctor() +0

我联系了他们,他们说你的应用程序应该在中等信任级别上运行。

我相信问题出在Microsoft.Practices.EnterpriseLibrary上,这个DLL应该在中等信任级别运行。

请告知如何在中等信任级别上运行所述DLL或任何其他解决方案,以使网站在共享主机上运行。

在 Windows 共享主机上以中等信任级别运行 ASP.NET 的 SecurityException

建议的解决方案是重新生成Microsoft Enterprise Library 组件以包含 AllowPartlyTrustedCallers() 属性,并使用此库自己的版本。

http://support.microsoft.com/kb/954274