System.Security.VerificationException when running ANTS profiler in .net 4.0
Asked Answered
I

0

7

I've been using RedGate's ANTS Performance Profiler for a while now. We recently updated our 3rd party dlls (Telerik) to their .net 4.0 version. When we did this, I no longer can profile our code because as soon as I hit a Telerik control I get:

System.Security.VerificationException: Operation could destabilize the runtime.

I spoke with RedGate and they told me, "Basically it's all down to Microsoft and their changes to CASPOL. ANTS has more features and these features require high privileges so that ANTS can read metadata out of assemblies in the running environment..."

Their suggestion was to run the process in full trust mode. How do I do that?

I've tried making adjustments to our Assembly.cs file, but since the problem doesn't seem to be generated from our code, there's not much I can do in terms of adjusting code.

P.S. Our app is a WPF/Winforms desktop application. I've found solutions for web apps by making changes to the web.config, but I can't really seem to find an equivalent solution (or understand it if it exists).

Impeccant answered 26/4, 2012 at 16:12 Comment(2)
I am facing the same problem. Did you find any solution to this?Homiletic
Another solution to get rid of this exception, is to add the assembly-in-concern to the "LineLevelBlacklist.xml" file.Hadden

© 2022 - 2024 — McMap. All rights reserved.