We're updating the issue view to help you get more done. 

Compiler emits unverifiable code which can cause VerificationExceptions at runtime

Description

The C# compiler (version 7.x+) emits unverifiable code in certain situations. Due to the SecurityTransparent attribute a runtime exception (VerifiableException) will be thrown when the unverifiable code executes (Releated issue: https://github.com/dotnet/roslyn/issues/27382.

This is intended compiler behavior but there is a compiler feature flag that can be used to disable those optimizations (for more info see https://github.com/dotnet/roslyn/pull/22772):

<Features>peverify-compat</Features>

An example of this problem is mentioned in https://github.com/re-motion/Relinq-SqlBackend/pull/7 where SqlContextExpressionVisitor.Visit throws a VerifiableException. This problem boils down to the problem outlined in https://github.com/dotnet/roslyn/issues/22485

Activity

Show:
Michael Ketting
May 15, 2020, 11:37 AM
Edited

Please incorporate patch by as a separate feature branch and integrate before the moq migration.

Assignee

Fillip Frackiewicz

Reporter

Patrick Widauer

Labels

None

Components

Fix versions

Priority

Normal
Configure