After lot of debugging I came to know exact cause of the crash. Firstly
Test 1:
I am loading an XML file from drive deserializing it against a MOTORCLASS and using the MOTORCLASS properties, later serializing back again to XML It works fine.
Test 2:
I have a Datatable and all its rows are mapped to the MOTORCLASS properties and now when serializing to XML a crash occurs..
When looking into MOTORCLASS property
`public object APPOINTMENT
{
get
{
return this.aPPOINTMENTField;
}
set
{
this.aPPOINTMENTField = value;
}
}`
On run time the TEST 1 sets APPOINTMENT as Xmlnode whereas TEST 2 assign APPOINTMENT as Datetime.
I think if I convert Datetime to Xmlnode than it should solve the problem. But not sure how to achieve it. I have tried
[System.Xml.Serialization.XmlElementAttribute("APPOINTMENT")]
.
But it still Datetime. Can anyone shed some light here.
TEST 1:
TEST 2: