Preventing serialization of properties in VB.NET
问题 I have a VB.NET class which I'm serializing via XML in an asmx file. I've added attributes to the datamember I want to ignore in serialization, but it's still returned. I also have the <DataContract()> attribute on my class and the DataMember attribute on all properties which should be serialized. My property declaration is: <ScriptIgnore()> _ <IgnoreDataMember()> _ Public Property Address() As SomeObject 回答1: By adding an attribute to the backing field and converting it from an auto-property