【问题标题】:System.Security.SecurityException in asp.netasp.net 中的 System.Security.SecurityException
【发布时间】:2013-04-02 07:08:57
【问题描述】:

我有一个应用程序,它在我的本地系统中运行良好,但是当我在服务器中运行相同的代码时,它给出的异常为

System.Security.SecurityException:请求类型的权限 'System.Web.AspNetHostingPermission,系统,版本=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 失败。

我曾尝试取消阻止 dll 的安全性,但这并没有解决我的问题。请给我一个解决方案

【问题讨论】:

标签: asp.net


【解决方案1】:

我使用caspol.exe解决了这个问题:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file:////c:/wwwroot/intepub/MyApp/bin/*" FullTrust -exclusive on

替换:c:/wwwroot/intepub/MyApp/bin/* 为您的 DLL 的路径。

Reference

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-16
    • 1970-01-01
    • 1970-01-01
    • 2015-04-24
    • 1970-01-01
    • 2016-07-31
    相关资源
    最近更新 更多