"Pete S" <(E-Mail Removed)> schrieb im Newsbeitrag
news

97854BD-AB32-43EE-8F50-(E-Mail Removed)...
> Thanks, Mark, I can see that this would work around the problem. What I
> don't
> understand is why I need to work around it in the first place. Isn't it a
> bug? Or is there a design rationale behind it? I see it isn't any
> different
> in the upcoming 2.0 either.
Pete,
The XML schema definition does include three different formats for
date/time: date, dateTime and time; it also includes one for a timespan:
duration.
According to the docs, duration maps to a string. Sadly, the TimeSpan
structure doesn't support automatic conversion like DateTime does. That's
not a bug, it's "by design"

You could post a suggestion at
http://lab.msdn.microsoft.com/productfeedback/ Then, maybe the next version
of the framework will include this feature.
BTW, I've forgotten the DataType. Change to code to
[XmlElement("Duration", DataType = "duration")]
public string XmlDuration
{
get { return Duration.ToString(); }
set { Duration = TimeSpan.Parse(value); }
}
Mark