I have been using xsd.exe to generate a class for deserializing XML into. I have decimal value in the source xsd that is not required:
Currently it works as it should. I'm using xsd v2.0.50727.42 and:
generates exactly what you've been looking for (without redundant ...Specified
field and property):
private System.Nullable portField;
[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
public System.Nullable Port {
get {
return this.portField;
}
set {
this.portField = value;
}
}