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 53230 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
In the IL2CPP tests with the .NET 4.6 profile of the Mono class libraries, code like the following can cause a managed exception in DiagnosticsConfiguration::GetConfigSection.
public class StuffToParse
public string aName;
public int aNumber;
public void VerifyXmlDeserialization()
const string xml = @"<?xml version='1.0' encoding='utf-8'?>
<StuffToParse xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
var stream = new MemoryStream(Encoding.UTF8.GetBytes(xml));
var serializer = new XmlSerializer(typeof(StuffToParse));
var parsed = (StuffToParse)serializer.Deserialize(stream);
The call to PrivilegedConfigurationManager.GetSection returns a Hashtable instance, so the cast to SystemDiagnosticsSection fails. It looks like this is a difference in behavior between the reference source, where DiagnosticsConfiguration::GetConfigSection is defined, and the Mono class library code, where PrivilegedConfigurationManager.GetSection is defined.
This is not a great bug report though, as the code above does work in a standalone example. I'm unsure what it is about the IL2CPP tests and the Unity player implementation with IL2CPP that cause this issue. So there is a chance it is not really a bug on the Xamarin side. However, there is certainly a theoretical bug here.
One possible solution is in https://github.com/mono/mono/pull/4497.