Skip to main content
gamedev.net
🔒 Locked

XmlSerializer Element Names

Started by Penance 0 replies 1k views
Original Post
Penance
Penance
I want to deserialize a class hierarchy from XML using XmlSerializer. class Base class Derived1:Base class Derived2:Base I use XMLInclude attributes on Base, and also provide the derived Types to the XmlSerializer constructor. Now my problem is that when I write the actual XML, it has to look like this: ... I'd rather be able to do ... but this causes XmlSerializer to throw exceptions saying that Derived1 was unexpected. Does anyone know how to make XmlSerializer accept this?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.