Serialization breaks in .NET 4.5

后端 未结 5 1666
栀梦
栀梦 2020-11-29 09:17

We have a serialization issue which only happens in .NET 4.5 - same code works fine in .NET 4. we\'re trying to serialize an inherited type with a few fields, both base and

5条回答
  •  旧巷少年郎
    2020-11-29 10:11

    I looked at your types more closely, and the problem is likely caused by a conflict between:

    public virtual object @Value
    {
    }
    

    on the Base and:

    private new object Value
    {
    }
    

    on the Derived class. Here are two things I would try:

    1. Try making the "new object Value" public. There might be a member access problem.
    2. Try renaming the Base's "@Value" to something like "BaseValue" or some other appropriate name. There might be a problem with your use of the '@' sign.

提交回复
热议问题