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 on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
In the past we had some hard to diagnose issues like https://bugzilla.xamarin.com/show_bug.cgi?id=38813 where reference assemblies were inadvertently used during runtime.
We should add proper validation so that we abort early and with a nice error message when Mono tries to use reference assemblies instead of the implementation assemblies (whatever the cause is, because this is never valid during runtime).
Right now, we only run cil-strip on the implementation assemblies to generate the ref asms which just empties method bodies, so it could be a bit more difficult to tell the assemblies apart. But we should at least assert that some fundamental types in corlib have method bodies.
In the future, it might be a good idea to annotate our ref asms with the [ReferenceAssembly] attribute (see https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.referenceassemblyattribute(v=vs.110).aspx) so we could more easily detect and deny all reference assemblies.
Issues like https://bugzilla.xamarin.com/show_bug.cgi?id=42584 (and numerous others) would be way easier to diagnose if we had this.
CoreCLR does the check here: https://github.com/dotnet/coreclr/blob/775003a4c72f0acc37eab84628fcef541533ba4e/src/vm/pefile.inl#L139-L148
*** This bug has been marked as a duplicate of bug 42584 ***