本文介绍了安全异常时,试图查看MVC网站上的Go Daddy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚上传我的MVC 4网站goddady主机。当我尝试浏览它,我得到:

I just uploaded my MVC 4 website to goddady host. When I try to browse it i receive:

安全例外

说明:应用程序试图执行不是由安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系或更改配置文件中的应用程序的信任级别。

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.

异常详细信息:System.Security.SecurityException:申请类型的权限'System.Security.Permissions.ReflectionPermission,mscorlib程序,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089'失败

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

我试着信任级别设置为完全,但我仍然得到同样的错误。下面是从web配置我system.we部分:

I tried to set trust level to full but I still get the same error. Here is my system.we section from the web config:

 <system.web>
<securityPolicy>
  <trustLevel name="Full" policyFile="internal"/>
</securityPolicy>
<customErrors mode="Off"/>

<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />

任何人都可以看到的问题?

Can anyone see the problem?

推荐答案

您可以尝试添加水平属性值为完全信任元素如下:

You can try to add level attribute with value Full for trust element as follows

 <trust level="Full" />

这篇关于安全异常时,试图查看MVC网站上的Go Daddy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 04:59