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

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

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

老外的解决方法:http://stackoverflow.com/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\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级别)

然后在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系统。

时间: 2024-07-30 09:08:43

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

String+变量”的操作是在运行时进行

“String+变量”因为编译时无法进行优化(为什么无法进行优化),所以这一条语句的操作是在运行时进行的,且会产生新的对象,而不是直接从jvm的string池中获取. 那么新的对象是保存在哪里呢?是堆中吗?如下代码: 1. String a = "ab"; 2. String bb = "b"; 3. String b = "a" + bb; System.out.println((a == b)); java中String的+运算符编译后其实是

linux 线程操作问题undefined reference to &#39;pthread_create&#39;的解决办法(cmake)

问题原因: pthread 库不是 Linux 系统默认的库,连接时需要使用静态库 libpthread.a. 所以在使用pthread_create()创建线程时,需要链接该库. 1. 终端:问题解决:在编译中要加 -pthread参数 gcc thread.c -o thread -pthread 2. qt的cmake配置: 可以修改CMakeLists.txt: Here is the right answer: ADD_EXECUTABLE(your_executable ${sour

Python 2.7安装setuptools时的UnicodeDecodeError解决办法

我猜~~~很多一开始学习python的同学们一定也遇到了这个问题,在安装setuptools时候会遇到UnicodeDecodeError的错误. 我学的是3.x,但是周围的人都说2.7好,╮(╯▽╰)╭一开始我也不在乎,但是工作需要使用mongodb,但是它的包暂时只有2.7,我点点点点. 无奈我也就换了版本,改为2.7,但是问题来了,当我想安装setuptools的时候,恶心的错误来了.真的不知道安装这种成熟的工具还有这种问题. 在经过各种谷哥.度娘之后,有的说在代码中制定编码,试了不行,有

PHP运行错最有效解决办法Fatal error: Out of memory (allocated 786432) (tried to allocate 98304 bytes) in H:\freehost\zhengbao2\web\includes\lib_common.php on line 744

原文 PHP运行错最有效解决办法Fatal error: Out of memory (allocated 6029312) Fatal error: Out of memory (allocated 786432) (tried to allocate 98304 bytes) in H:\freehost\zhengbao2\web\includes\lib_common.php on line 744疑问:786432 是指786432bytes?即:768MB 98304 bytes=9

python安装markupsafe模块时卡死的解决办法

起因: 升级OS X从10.8到10.9,会发现在安装python的markupsafe模块时一直卡住. 当时的机器环境是: OSX 10.9, XCode 4.6.2, Python 2.7.6, Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) 界面一直停留在下面的情况 mbp:MarkupSafe-0.23 $ python setup.py install running install running bdis

PHP编译安装时常见错误解决办法,php编译常见错误

PHP编译安装时常见错误解决办法,php编译常见错误 1.configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution 解决方法: yum -y install libxslt-devel 2.configure: error: Could not find net-snmp-config binary. Please check your net-snmp installa

linux编译安装时常见错误解决办法

linux编译安装时常见错误解决办法 This article is post on https://coderwall.com/p/ggmpfa 原文链接:http://www.bkjia.com/PHPjc/1008013.html configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution复制代码 代码如下:yum -y install libxslt-devel c

C#多个Windows Service 传递给ServiceBase时,只运行其中一个的解决办法

在之前编写的一个服务里,ServiceBase[]里只有一个, static class Program { /// <summary> /// 应用程序的主入口点. /// </summary> static void Main() { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new Service1(), }; ServiceBase.Run(ServicesToRun); } } 运行是

MySQL删除数据库时无响应解决办法

删除远程主机上MySQL中的一个数据库时,远程主机一直在响应,无法正常删除. 这个问题的解决办法如下:在远程主机上登录MySQL,执行show full processlist;观察state和info两列,查看有哪些线程在运行.经过查询发现之前远程删除的时候由于网络中断,锁表了.所以导致再次登录的时候删除操作无响应.这时候只要使用kill命令+对应线程前面id,将线程结束掉,就可以正常删除了. REF: https://blog.csdn.net/cccheer/article/details