[Mono-dev] urgent issue with reading xml into a dataset (System.InvalidCastException)

Rosenberg, Shlomi ShRosenberg at nds.com
Fri Apr 4 02:09:45 EDT 2008

I hava a dataset with a table containing the following row:
stepTable.Columns.Add("FuncXml", typeof(LabRat.LrtXml));
in the XML file it looks like this:
  <Func Name="CUT_IntPassiveIn()" Direction="PASSIVE_MOCK">
    <Param Name="paramLen" Type="int" Len="1" InOut="IN" Union="FALSE" Callback="">
    <Param Name="single" Type="int" Len="1" InOut="IN" Union="FALSE" Callback="">
    <Return Name="retVal" Type="int" Len="1" InOut="OUT" Union="FALSE" Callback="">
LrtXml is a class that implements IXmlSerializable, and it works fine on .NET framework 2.0.
When running on Linux using mono, i keep getting:
System.InvalidCastException: Unknown target conversion type
  at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider) [0x00000]
  at System.Convert.ChangeType (System.Object value, System.Type conversionType) [0x00000]
  at System.Data.XmlDataReader.StringToObject (System.Type type, System.String value) [0x00000]
  at System.Data.XmlDataReader.ReadElementElement (System.Data.DataRow row) [0x00000]
  at System.Data.XmlDataReader.ReadElementContent (System.Data.DataRow row) [0x00000]
  at System.Data.XmlDataReader.ReadElement (System.Data.DataRow row) [0x00000]
  at System.Data.XmlDataReader.ReadDataSetContent () [0x00000]
  at System.Data.XmlDataReader.ReadTopLevelElement () [0x00000]
  at System.Data.XmlDataReader.Process () [0x00000]
  at System.Data.XmlDataReader.ReadXml (System.Data.DataSet dataset, System.Xml.XmlReader reader, XmlReadMode mode) [0x00000]
  at System.Data.DataSet.ReadXml (System.Xml.XmlReader reader, XmlReadMode mode) [0x00000]
  at System.Data.DataSet.ReadXml (System.Xml.XmlReader r) [0x00000]
  at System.Data.DataSet.ReadXml (System.String str) [0x00000]
  at LabRat.LrtTestEngine.openLrs () [0x00000]
And i see it happens before the LrtXml.ReadXml is even called.
Can someone please help with this, i need a solution urgently.
Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080404/1f3f3513/attachment-0001.html 

More information about the Mono-devel-list mailing list