Skip to content

Unable to deserialize properties with certain names.... #10

@ZNS

Description

@ZNS

This is an extremely strange issue however I've tested it several times and it seems to be consistent at least.

Take the following classes:

public class MyClass {
    public int Id { get; set; }
    public string Name { get; set; }
    public Sub MySub { get; set; }

    public MyClass()
    {
    }
}

public class Sub
{
    public string Id { get; set; }
    public string DId { get; set; }
    public string Something { get; set; }

    public Sub(){}
}

The following will fail with an exception (can be different exceptions)

var myClass = new MyClass() {
    Id= 100,
    MySub=new Sub() { Id= "SubId" },
    Name="Testclass"
};

var serializer = MsgPack.Serialization.MessagePackSerializer.Create<MyClass>();
var data = serializer.PackSingleObject(myClass);
var result = serializer.UnpackSingleObject(data);

However comment out the property "DId" from class Sub or simply rename it to for example "SId" and it will work, "FId" will for example not work either. I'm running 0.3.2 for aspnet 4.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDetected as bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions