[转帖]“操作可能会破坏运行时稳定性”的解决办法
<strong>错误提示:</strong><br/>操作可能会破坏运行时稳定性。 <br/>说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 <br/><br/>异常详细信息: System.Security.VerificationException: 操作可能会破坏运行时稳定性。<br/><br/>源错误: <br/><br/>执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 <br/><br/><strong>原因:<br/></strong>framework平台信任级别被主机商修改了(国外主机普通都会修改),导致信任级别过低。<br/><br/><strong>解决方法1:</strong><br/>找到framework配置文件路径:C:\WINDOWS\Microsoft.NET\Framework\<font color="red">v2.0.50727</font>\CONFIG\web.config (注意不同版本红色部分目录可能不一样,如果购买虚拟主机,请联系主机商修改)<br/>用计事本打开文件找到下面这段<br/> <span style="COLOR: rgb(0,0,255)"> <location allowOverride="true"></span><br/> <system.web><br/> <securityPolicy><br/> <trustLevel name="Full" policyFile="internal"/><br/> <trustLevel name="High" policyFile="web_hightrust.config"/><br/> <trustLevel name="Medium" policyFile="web_mediumtrust.config"/><br/> <trustLevel name="Low" policyFile="web_lowtrust.config"/><br/> <trustLevel name="Minimal" policyFile="web_minimaltrust.config"/><br/> </securityPolicy><br/><font color="red"> <trust level="Full" originUrl=""/></font><br/> <identity impers/><br/> </system.web><br/> </location><br/>红色<font color="red"><font color="black">trust</font></font>部分的level默认是为full,有的主机商吧这里设置为Medium或其他,会提示不受信任的错误,改回Full即可。<br/><br/>
页:
[1]