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
Developer Community or GitHub 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.
When calling XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr,string xmlLang,XmlSpace xmlSpace) Constructor with a XmlNameTable nt that wasn't used to Construct XmlNamespaceManager nsMgr, Based on MSDN documentation
(https://msdn.microsoft.com/en-us/library/xc8bact5(v=vs.110).aspx) an XmlException has to be thrown. However, this doesn't happen to be the case when running on Xamarin Android:
To reproduce run the following code snippet:
System.Xml.NameTable v0 = new System.Xml.NameTable();
System.Xml.NameTable v13 = new System.Xml.NameTable();
System.Xml.XmlNamespaceManager v14 = new System.Xml.XmlNamespaceManager((System.Xml.XmlNameTable)v13);
System.Xml.XmlParserContext v21 = new System.Xml.XmlParserContext((System.Xml.XmlNameTable)v0, (System.Xml.XmlNamespaceManager)v14, null, System.Xml.XmlSpace.None);
catch (System.Xml.XmlException e)
Expected output: XmlException. returns 0
Xamarin Android output: No exception is thrown. returns -1
The Windows Phone 8.1 version of this correctly throws an XmlExcetpion.
This code snippet was placed in a PCL project and was run on an android 4.4.2
emulator and a Windows Phone 8.1 emulator
Additional Build Environment info:
Xamarin.Android Version: 4.16.0 (Business Edition)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
This wasn't specific to Android. And is fixed now, with the referencesource implementation.
Note: this should be fixed as of ~ 50db47379083f823d0942870468df1fcda971f97 . This was tested with f482b9bd9b890cd99c3b93872a337b2b65f8f12b though.