Error converting value {null} to type 'System.DateTime' Json Response VB.NET
<p>I am trying to use JsonConvert.DeserializeObject to parse a JSON response that I am getting back from a web-service. I have the XSD Schema file for the service, which I ran though the .net converter tool to make a Class. Which everything works perfectly, other than the below field. I get the error in the title. It only happens on Array's of Dates, single dates that have a null return work perfectly fine and are skipped due to turning on the NullValueHandling.Ignore setting.  Does anyone know how I could use JSON.NET to skip over theses null dates in the array too? Thanks in advance! </p>

<p>JSON Response: "TheDatesReturned":[null,null,null,null,null,null],</p>

<pre><code> Private TheDatesReturnedField() As Date

 &lt;System.Xml.Serialization.XmlElementAttribute("TheDatesReturned", DataType:="date")&gt; _
Public Property TheDatesReturned() As Date()
    Get
        Return Me.TheDatesReturnedField
    End Get
    Set(value As Date())
        Me.TheDatesReturnedField= value
    End Set
End Property
</code></pre>

<p>NOTE: Changing it to an array of strings fixes it as well, but then they are no longer typed correctly when I actually do get a response. </p>

<p>EDIT: </p>

<p>If any anyone comes across this and is wondering how to get XSD.exe to do it for them. They can add nillable="true" to the field in the XSD file</p>

<pre><code>&lt;xsd:element maxOccurs="6" minOccurs="0" name="TheDatesReturned" type="xsd:date" nillable="true"&gt;
</code></pre>

<p>This will then generate the Class with this, which should take care of the issue.</p>

<pre><code>Private TheDatesReturnedField() As System.Nullable(Of Date)   
</code></pre>