操作可能会破坏运行时稳定性的解决办法
点击次数:729 更新时间:2013-07-08有些虚拟主机用户使用组合应用系统时会出现以下错误:
原因:
framework平台信任级别被主机商修改了(国外主机普通都会修改),导致信任级别过低。
解决方法1:
找到framework配置文件路径:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config (注意不同版本红色部分目录可能不一样,如果购买虚拟主机,请联系主机商修改)
用计事本打开文件找到下面这段
<location allowOverride="true"> <system.web> <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=""/> <identity impersonate="true"/> </system.web> </location>
红色trust部分的level默认是为full,有的主机商吧这里设置为Medium或其他,会提示不受信任的错误,改回Full即可。
解决方法2:
可以把上面蓝色部分的allowOverride改为true(表示允许用户自定义trust级别)
然后在网站根目录的web.config文件的</system.web>上面一行加上<trust level="Full" originUrl=""/>
改好的web.congfig如下
<?xml version="1.0" encoding="UTF-8"?> <configuration> ....中间部分省略 <trust level="Full" originUrl=""/> </system.web> </configuration>