且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

XmlSerializer ShouldSerialize *不适用于基本类型属性

更新时间:2023-09-15 21:45:40

XmlSerializer在成员 Name 的.DeclaringType上查找方法,而不在.ReflectedType上查找方法.这就是为什么它不起作用的原因.

The XmlSerializer looks for the method on the .DeclaringType of your member Name, not on the .ReflectedType. This is why it doesn't work.