失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 操作可能会破坏运行时稳定性的解决办法

操作可能会破坏运行时稳定性的解决办法

时间:2020-04-03 09:19:58

相关推荐

操作可能会破坏运行时稳定性的解决办法

如果你用了ANTS Performance Profiler的话,并且选择了“Line-Level”就有可能出现下面问题了:

System.Security.VerificationException: 操作可能会破坏运行时稳定性。

老外的解决方法:/questions/378895/operation-could-destabilize-the-runtime

This happens regularily to me when using ANTS Performance Profiler with projects that make use of HtmlAgilityPack. The solution to this was to tell the profiler to exclude HtmlAgilityPack by adding <assemblyName>HtmlAgilityPack</assemblyName> to the file "C:\Users\YourUserName\AppData\Local\Red Gate\ANTS Performance Profiler 9\LineLevelBlacklist.xml" (Replace "YourUserName" by your actual user name).

我试了,貌似没有用,我还是直接在软件里面修改分析配置的模式,不选Line-Level和With Source的。

错误提示:

操作可能会破坏运行时稳定性。

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Security.VerificationException: 操作可能会破坏运行时稳定性。

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

原因:

framework平台信任级别被主机商修改了(国外主机普通都会修改),导致信任级别过低。

解决方法1:

找到framework配置文件路径:C:\WINDOWS\\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级别)

然后在pageadmin自带的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>

通过以上修改后就可以正确的运行Pageadmin系统。

如果觉得《操作可能会破坏运行时稳定性的解决办法》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。