Field is member of a type which is serializable but is of type which is not serializable

后端 未结 1 666
萌比男神i
萌比男神i 2020-12-21 03:26

I\'m developing a C# library with .NET Framework 4.7.

I want to convert the class ProductionOrderXmlFile into a XML file:

[Serializable]         


        
相关标签:
1条回答
  • 2020-12-21 04:07

    Lose the [Serializable]. Just throw it away - all of them. XmlSerializer doesn't care about it, and you don't need it. It isn't helping you, and is causing this false-positive warning.

    [Serializable] relates essentially just to BinaryFormatter, which usually isn't a good choice.

    0 讨论(0)
提交回复
热议问题