How to serialize non-static child class of static class

前端 未结 3 1619
-上瘾入骨i
-上瘾入骨i 2021-01-04 12:10

I want to serialize a pretty ordinary class, but the catch is it\'s nested in a static class like this:

public static class StaticClass
{
    [Serializable]
         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-04 12:36

    Either make the class non nested or consider using the DataContractSerializer instead.

提交回复
热议问题