Serialize a Static Class?

后端 未结 6 1163
耶瑟儿~
耶瑟儿~ 2020-11-27 06:25

What happens if we serialize a static class? Can more than one instance of the static class be created if we serialize it?

[Serializable]
public static class         


        
6条回答
  •  -上瘾入骨i
    2020-11-27 07:06

    You can't serialize static classes (or any class whatsoever) using built-in .NET serialization features. You can only serialize instances of classes.

提交回复
热议问题