web.config文件中的安全异常 [英] Security Exception in web.config file

查看:78
本文介绍了web.config文件中的安全异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临安全例外问题。

我正在尝试导出pdf文件,但我收到此错误:

I am facing an Security Exception issue.
I am trying to export an pdf file but I am getting this error:

Description: The application attempted to perform an operation not
allowed by the security policy.  To grant this application the
required permission please contact your system administrator or change
the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly
does not allow partially trusted callers.



现在我正在更改web.config文件通过设置ASP.NET托管信任级别

但仍然无法正常工作:我收到此分析程序错误:

分析程序错误消息:此配置部分不能用于

这条路径。当站点管理员使用< location allowOverride =false>锁定对此部分的访问权限时,会发生这种情况。来自

继承的配置文件。



这是我在web.config文件中添加的代码:




Now I am changing the web.config file by setting ASP.NET hosting trust level
but still it is not working:I am getting this Parser error:
Parser Error Message: This configuration section cannot be used at
this path. This happens when the site administrator has locked access
to this section using <location allowOverride="false"> from an
inherited configuration file.

This the code I am adding in web.config file:

<location allowOverride="true">
    <system.web>
      <securityPolicy>
       <trustLevel name="Full" policyFile="internal" />
      </securityPolicy>
      <trust level="Full" originUrl="" />
     </system.web>
   </location>





我也试过这些信任等级一一个:



And I have also tried with these trust level one by one:

<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" />
<trustLevel name="Custom" policyFile="web_CustomTrust.config" />







但它仍然是不工作

请帮忙解决这个问题。通过我在Godaddy中托管的方式。




But still it is not working
Please can help fixing this.By the way I am hosted in Godaddy.

推荐答案

"This happens when the site administrator has locked access
to this section using <location allowOverride="false"> from an
inherited configuration file."



如果您是该Web服务器的管理员,请找到具有该设置的文件并首先更改该文件。

如果您不是管理员,请找他并告诉他。


If you are the administrator of that web server, find that file with that setting and change that first.
If you are not the administrator, find him and tell him.


这篇关于web.config文件中的安全异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆