I spent time today trying to track down a bug in the project I'm working on. I'm deserializing custom classes from XML stored as resources. It works great, except when you introduce a tiny typo. I kept getting this completely useless error:
Due to the way .NET handles XML serialization and deserialization (creating a temporary assembly), there is no stack trace, and no clue of what went wrong.
Although this can be caused be any number of issues, in my case, one of the fields of my class is another class. I had improperly marked it with [XmlAttribute] instead of [XmlElement].
It appears the only way to debug this is to comment out the fields of the class, and uncomment each one, until it breaks again.
<Sigh>... back to work...