Can you give more information about when this will happen and with what serializer? Most serializers have the ability to ignore certain elements - NonSerializedAttribute for BinaryFormatter , XmlIgnoreAttribute for XmlSerializer , etc.
Having an instance of PropertyDescriptor in your class usually means that your class acts like a bag of properties; in this case, you may need to do custom serialization ( ISerializable / IXmlSerializable ). If there is a field for any other reason, just check it to ignore it.
These (or similar symptoms) are also very common when you have an event (for example, a change notification event / INotifyPropertyChanged ) that a user interface is connected to (data binding); in this case, you need to mark the support field as unserialized. I do not know about VB, but with C # you can do this using "field events" as follows:
[field: NonSerialized] public event EventHandler BarChanged;
source share