I\'m getting this message,\"The string \'7/22/2006 12:00:00 AM\' is not a valid AllXsd value.\", when deserializing an XML, the element contains a date, this is the property
For those who come across this here is the simplest answer, I ran into the same issue, but didn't need nullable DateTime. The XMLElement only need a get not a set when rendering XML.
private DateTime _fechaInicioRelacion;
[XmlElement("FEC_INICIO_REL")]
public string FechaInicioRelacionString
{
get
{
return _fechaInicioRelacion.ToString("yyyy-MM-ddTHH:mm:ss");
}
set { }
}
[XmlIgnore]
public DateTime FechaInicioRelacion
{
get { return _fechaInicioRelacion; }
set { _fechaInicioRelacion = value; }
}