In order to be serialized to XML, Uri
class should have a parameterless constructor, which it doesn't: Uri
is designed to be immutable. Honestly, I can't see why it cannot be serialized without having a parameterless constructor.
To circumvent this, either change URI
property type to string
, or add one more property called _URI
, mark URI
with XmlIgnoreAttribute
and rewrite it's get
method as get { return new Uri(_URI); }
.