Workaround for operations that may disrupt run-time stability

Source: Internet
Author: User

If you use Ants Performance Profiler, and you choose "Line-level" You may have the following problems:

System.Security.VerificationException: operation may break runtime stability.

How to solve the foreigner: Http://stackoverflow.com/questions/378895/operation-could-destabilize-the-runtime
This happens regularily to me when using the ANTS performance Profiler with the projects that make use of htmlagilitypack. The solution 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).

I tried, seemingly no use, I still directly in the software to modify the analysis configuration mode, not select Line-level and with source.

error message:
Operations can disrupt run-time stability.
Description: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.

Exception Details: System.Security.VerificationException: operation may break runtime stability.

SOURCE Error:

An unhandled exception was generated during the execution of the current WEB request. You can use the following exception stack trace information to determine information about the cause of the exception and where it occurred.

Reason:
The Framework platform trust level has been modified by the host vendor (the foreign host is generally modified), resulting in a low level of trust.

Workaround 1:
Locate the Framework configuration file path: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\Web.config (Note that different versions of the red part of the directory may not be the same, if you purchase a virtual host, please contact the host to modify)
This open file finds the following paragraph.
<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>
RedTrustPart of the level is the default is full, some of the host business here is set to Medium or other, will prompt the untrusted error, change back to full.

Workaround 2:
You can change the allowoverride of the blue section above to True (indicating that the user is allowed to customize the trust level)

Then add <trust level= "full" originurl= ""/> on the </system.web> line of the Web. config file that pageadmin comes with.

The modified web.congfig are as follows
<?xml version= "1.0" encoding= "UTF-8"?>
<configuration>
.... Middle part omitted
<trust level= "full" originurl= ""/>
</system.web>
</configuration>

The Pageadmin system can be run correctly after the above modification.

Workaround for operations that may disrupt run-time stability

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.