Bug description
I have code with a class with private field of typereadonly Dictionary<string, object>.
It was working on MessagePack version 2.1.115. Then I updated MessagePack to version 2.3.75 and I got the bug. This dictionary is not being deserialized.
Repro steps
Demo:
[DataContract]
public class MyClass
{
[DataMember(Name = "Key", Order = 0, EmitDefaultValue = false)]
private readonly Guid? _key;
[DataMember(Name = "Body", Order = 1, EmitDefaultValue = false)]
private readonly Dictionary<string, object> _body = new Dictionary<string, object>();
public MyClass(Guid? key)
{
_key = key;
}
public void SetValue(string name, object value)
{
_body[name] = value;
}
}
var obj = new MyClass(Guid.NewGuid());
obj.SetValue("name", "my name");
var opt = MessagePack.MessagePackSerializerOptions.Standard.WithResolver(MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate.Instance);
var bytes = MessagePack.MessagePackSerializer.Serialize(obj, opt);
var json = MessagePack.MessagePackSerializer.ConvertToJson(bytes); // just for check that json has _body' values.
var afObj = MessagePack.MessagePackSerializer.Deserialize(obj.GetType(), bytes, opt); // here afObj._body is null, it's a bug
Expected behavior
It should work like in previous versions: readonly Dictionary is being deserialized.

Actual behavior
Readonly Dictionary is not being deserialized.
I was testing: It is working again if I whether remove readonly modificator from Dictionary or Order from DataMember attributes. But it is not a good solution because the original code was working perfect on previous versions of MessagePack.

- Version used: MessagaPack 2.3.75
- Runtime: .Net Core 3.1
Additional context
If it is a bug I hope you will be able to fix it soon :)
In other case could you provide workaround for this?
Bug description
I have code with a class with private field of type
readonly Dictionary<string, object>.It was working on
MessagePackversion2.1.115. Then I updatedMessagePackto version2.3.75and I got the bug. This dictionary is not being deserialized.Repro steps
Demo:
Expected behavior
It should work like in previous versions: readonly Dictionary is being deserialized.

Actual behavior
Readonly Dictionary is not being deserialized.

I was testing: It is working again if I whether remove
readonlymodificator fromDictionaryorOrderfromDataMemberattributes. But it is not a good solution because the original code was working perfect on previous versions ofMessagePack.Additional context
If it is a bug I hope you will be able to fix it soon :)
In other case could you provide workaround for this?