主营业务:网站制作 网站优化 小程序制作 石家庄网站制作网站建设有限公司欢迎您!
石家庄闪云网络科技有限公司
客服热线15383239821
如何让自己的网站更有质量?

System.Security.SecurityException: 该程序集不支持部分受信任的调用方

发布时间:2011/6/20 11:32:57

这是由ASP.NET安全性引起的异常,有可能的原因是部署服务器上的machine.config或web.config中配置的安全策略被修改过。
在.net2.0中,Asp.Net默认在C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config中配置了网站的信任级别:

      <securityPolicy>
        <trustLevel name="Full" policyFile="internal"/>
        <trustLevel name="High" policyFile="web_hightrust.config"/>
        <trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
        <trustLevel name="Low" policyFile="web_lowtrust.config"/>
        <trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
      </securityPolicy>
      <trust level="Full" originUrl=""/>

本来默认是Full级别,但可能服务器供应商出于安全考虑而采用了其他策略。
当前有一种办法,就是在你网站根目录下的web.config中重新声明所选用的策略为Full:

<trust level="Full" originUrl=""/>

它在配置文件中的层次结构如下:
<location allowOverride="true">
    <system.web>
        <trust level="Full" originUrl=""/>
    </system.web>
</location>
location是根元素。

如果这样扔无法解决此问题,则请联系服务器供应商协助解决此问题

相关新闻推荐

在线客服 : 服务热线:15383239821 电子邮箱: 27535611@qq.com

公司地址:石家庄市新华区九中街江西大厦4062

备案号:冀ICP备2022000585号-4