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.
Created attachment 1067 [details]
nUnit tests which fail under mono
When adding a XNamespace element to an XElement the element is ignored. Example:
var ns = XNamespace.Get(XmlSchema.InstanceNamespace);
var element = new XElement("Demo", new XAttribute(ns + "nil", true), new XAttribute(XNamespace.Xmlns + "xsi", ns));
Assert.AreEqual("<Demo xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" />", element.ToString());
This test succeeds under MS.NET 4 but fails under mono 2.10.6. Mono returns duplicate namespace declaration:
<Demo d1p1:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:d1p1="http://www.w3.org/2001/XMLSchema-instance" />
Also MS.NET 4 has a defferent naming scheme if the namespace is not explicitly declared. Ms uses p1 as a default prefix while mono starts with d1p1.
A test class is included as an attachment. Both test succeed under MS.NET 4, but fail under mono 2.10.6.
This is pretty bad for XElement performance, but I made a fix in git master d18e065 anyways. Thanks for the report.