Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6469505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:59:57+00:00 2026-05-25T05:59:57+00:00

It seems when I instrument an assembly using OpenCover , assemblies with the SecurityTransparent

  • 0

It seems when I instrument an assembly using OpenCover, assemblies with the SecurityTransparent attribute (and AllowPartiallyTrustedCallers it seems) will throw a VerificationException. I’d like to know why that is and if there is an alternative solution to recompiling the assembly without those attributes included i.e. conditional compilation, as seen in the downloaded code for MVC3 (but strangely I can’t find the same when I browse the repository on codeplex). Note without those assembly attributes the coverage runs without issue.

OpenCover uses a CALLI instruction to send instrumentation data (sequence point identifier) to the profiler. It seems the act of calling this instruction causes the exception to occur; the instrumentation part seems fine and the JIT compiles the new instrumented method without issue. The act of instrumentation doesn’t cause issues because if I remove all instrumentation other than make Tiny methods Fat and small branches long the code executes without issue.

Currently I am using Mono.Cecil to examine assemblies that pass the “include-in-coverage” filter and report the issue to the user whilst skipping the instrumentation and then continue, but I’d like to know if there is anything I a can do during the profiling to avoid this issue and avoid recompilation.

So to sum up 2 questions “Why does it happen?” and “Can I avoid it without recompilation?”

NOTE: PartCover also seems to exhibit this issue and it uses a different method to record visit points.

NOTE: I am the developer of OpenCover (an open source code coverage tool) and currently the maintainer of PartCover.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T05:59:57+00:00Added an answer on May 25, 2026 at 5:59 am

    I posted the answer on MSDN forums – Why do assemblies with the SecurityTransparent attribute cause instrumented code via a profiler to throw a VerificationException?

    and got an answer that I should look at the COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST flag (.NET4 only it seems)

    see also:

    http://www.madgnome.fr/2011/09/verificationexception-and-profiling-the-hidden-flag/

    https://web.archive.org/web/20190114032309/https://blogs.msdn.microsoft.com/davbr/2010/01/07/clr-v4-stuff-that-may-break-your-profiler

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seems that requirements on safety do not seem to like systems that use AI
When using the Gather Leaked Memory Contents of the Leaks Instrument, it seems to
Seems like a simple enough question but I can't seem to find the answer.
Seems like a simple problem: I have an SVN repo inside our firewall. I
Seems so basic, I can't believe I don't know this! I just need a
Seems like the subtraction is triggering some kind of issue and the resulting value
Seems like as really simple thing to do, but I just can't track it
Seems like every C# static analyzer wants to complain when it sees a public
I'm using Visual Studio Web Setup Project to instrument web application install kit. Unfortunately,
It seems that the System.Diagnostics.Debug , and System.Diagnostics.Trace are largely the same, with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.