Bug 9740 - Deserializing a WCF Web Object on Linux fails because only the local namespace of its parameters is considered.
Summary: Deserializing a WCF Web Object on Linux fails because only the local namespac...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-01-23 14:08 UTC by ancientblasterv
Modified: 2013-02-02 05:04 UTC (History)
3 users (show)

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

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 9740 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 ancientblasterv 2013-01-23 14:08:03 UTC
On Windows, with .NET. There is no issue serializing or deserializing the following WCF web object:

public class Payload
    public Payload() {}

    public class SubPayloadOne
        public String Name { get; set; }
        public int Count { get; set; }

    public class SubPayloadTwo
        public String Name { get; set; }
        public int Number { get; set; }

    public SubPayloadOne P1 { get; set; }
    public SubPayloadTwo P2 { get; set; }

On Mono (on Ubuntu), attempting to deserialize the web object in the example above will result in the following error: System.InvalidOperationException: Failed to set value of type String[Payload+SubPayloadOne+Name] for property String[Payload+SubPayloadTwo+Name] String ---> System.ArgumentException: failed to convert parameters

Mono is not including the full namespace when deserializing the object. In other words, it is confusing Payload.SubPayloadTwo.Name for Payload.SubPayloadOne.Name, because both objects are "Name" if you do not consider their full namespace.

I resolved this problem by renaming Payload.SubPayloadOne.Name or Payload.SubPayloadTwo.Name to something else, for example, Payload.SubPayloadTwo.NameTwo, to avoid the conflict. 

Mono should take into account the full namespace of each parameter so that conflicts do not occur during deserialization.

(It's possible that this issue affects serialization as well)