User login |
SerializationSo after stumbling around trying to load objects from an XML file, I see the Serialization package - waaayy cool. It's almost point-and-shoot simple. I get the serialization working for the project - all very cool - and all of a sudden it stops. Stops cold. Won't load, won't unload. No clues, just a cryptic message that "Can't serialize object". Hmmmm.... after considerable time trying to figure out what the hell I'd changed, I stumpled on it. I'd added a property which returned a Component. And guess what? You can't serialize components (which answers the question of "why aren't forms serialized"). The moral is, every single public property or field will be serialized unless controlled by attributes. Every one of 'em.
|