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.