Bug 30444 - Different serialization of class inheriting Dictionary and implementing IXmlSerializable when using WCF
Summary: Different serialization of class inheriting Dictionary and implementing IXmlS...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies ()
Version: 4.0.0
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-05-26 10:01 UTC by Rafał
Modified: 2017-09-06 16:55 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Project for reproduction + sent packets (3.31 KB, application/octet-stream)
2015-05-26 10:02 UTC, Rafał

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 30444 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 original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Rafał 2015-05-26 10:01:06 UTC

First: Great job with Mono! Amazing tool.

I work with two applications: client and server, both C# .NET using WCF for communication. Lately I've been porting client application so that it can be deployed on Linux (ubuntu-14.04.2-desktop-amd64). Server remains on Windows. And then comes a problem with communication.

When contract sends an objects similar to:

public class MyData: Dictionary< string, string >, IXmlSerializable

I get different behavior depending on where the app runs:

Windows (both Mono and .Net) produces as XmlWrite dictates: <data><a>b</a><c>d</c></data>

Ubuntu produces as if it serializes dictionary: <data xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><d4p1:KeyValueOfstringstring><d4p1:Key>a</d4p1:Key><d4p1:Value>b</d4p1:Value></d4p1:KeyValueOfstringstring><d4p1:KeyValueOfstringstring><d4p1:Key>c</d4p1:Key><d4p1:Value>d</d4p1:Value></d4p1:KeyValueOfstringstring></data>

It may be already solved problem that just Windows mono got already submitted and Ubuntu mono is behind, but 'mono --version' says the same version number:
Ubuntu: Mono JIT compiler version 4.0.1 (tarball Tue May 12 15:39:23 UTC 2015)
Windows: Mono JIT compiler version 4.0.1 (Visual Studio built mono)

I'm attaching small project on which I've reproduced an issue.

Currently I'm working around the problem by changing implementation to compose Dictionary instead of inheriting.

Comment 1 Rafał 2015-05-26 10:02:12 UTC
Created attachment 11328 [details]
Project for reproduction + sent packets