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

后端 未结 1 675
萌比男神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)
提交回复
热议问题