Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 序列化属性即使为空_C#_Xml Serialization - Fatal编程技术网

C# 序列化属性即使为空

C# 序列化属性即使为空,c#,xml-serialization,C#,Xml Serialization,如何让XmlSerializer序列化空字符串属性 [XmlElement("description")] public string Description { get; set; } 我没有尝试过,但XmlElementAttribute的“IsNullable”可能对字符串有帮助,只是为了确定:您是否已将IsNullable设置为false?

如何让XmlSerializer序列化空字符串属性

        [XmlElement("description")]
        public string Description
        {
            get;
            set;
        }

我没有尝试过,但XmlElementAttribute的“IsNullable”可能对字符串有帮助,只是为了确定:您是否已将IsNullable设置为false?