Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 59967 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 25105 [details]
This is a feature request from C# 7.2 Roslyn which has this new "optimization" which breaks peverify. They are aware of it but consider this to be peverify bug/limitation.
With following code
public enum Type
readonly Type type;
public override string ToString ()
return type.ToString ();
public static void Main ()
attached .exe is generated with 2.6 csc and peverify fails with
Not Verifiable: Cannot take the address of a init-only field at 0x0002
Is there a spec of that change? This sample is not enough to figure out what the new behavior is.
I am not really sure but I asked at https://github.com/dotnet/roslyn/issues/22485
I guess the easiest workaround would be to check for IsReadOnlyAttribute attribute on a struct and alter the checks based on that
This is hurting us on performace we need to run roslyn in legacy IL codegen for BCL builds