"Operation could destabilize the runtime"
Uwe Keim
Posts: 48 Bronze 3
Using the latest ANTS Performance Profiler together with this small console program:
My question:
How can I work-around this issue?
(I need to have line-level profiler results so switching to a lower mode is not an option)
namespace AntsHtmlAgilityPackTests { using HtmlAgilityPack; // Included via NuGet package. internal static class Program { private static void Main() { new HtmlDocument(); } } }An error occurs when running inside ANTS Performance Profiler with highest profiling mode (line-level timings):
The stack trace is:System.Security.VerificationException: Operation could destabilize the runtime
at HtmlAgilityPack.HtmlDocument..ctor() in D:SVN_CHECKOUThtmlagilitypackTrunkHtmlAgilityPackHtmlDocument.cs:Line 26. at AntsHtmlAgilityPackTests.Program.Main() in c:UsersukeimTestsMain.cs:Line 12.When running in a lower profiling mode ("orange", method-level timings), no error occurs.
My question:
How can I work-around this issue?
(I need to have line-level profiler results so switching to a lower mode is not an option)
Comments
I see no special behaviour here.
Would be interesting to see the "instrumented" code of this constructor after it goes through ANTS Profiler.
Please try adding HtmlAgilityPack.HtmlDocument to the line-level timings block list. For more information, see: http://documentation.red-gate.com/display/APP9/Profiling+SecurityTransparent+and+partially-trusted+assemblies#ProfilingSecurityTransparentandpartially-trustedassemblies-block-list
Dom.
Project Manager,
Redgate.
I've added
to the file
and restarted the profiler.
After that, the profiling succeeds without any errors, even in line level mode.