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

Veerapuram Varadhan vvaradhan at novell.com
Fri Apr 4 05:49:41 EDT 2008

Hi Shlomi,

On Fri, 2008-04-04 at 09:09 +0300, Rosenberg, Shlomi wrote:
> Hi,
> 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:
> <FuncXml>
>   <Func Name="CUT_IntPassiveIn()" Direction="PASSIVE_MOCK">
>     <Param Name="paramLen" Type="int" Len="1" InOut="IN" Union="FALSE"
> Callback="">
>     </Param>
>     <Param Name="single" Type="int" Len="1" InOut="IN" Union="FALSE"
> Callback="">
>     </Param>
>     <Return Name="retVal" Type="int" Len="1" InOut="OUT" Union="FALSE"
> Callback="">
>     </Return>
>   </Func>
> </FuncXml>
> 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]

Can you file a bug and attach a test sample to reproduce this issue?
IIUC, in Mono's System.Data.DataSet, the default implementation is to
get the serialization data either from XML or binary data.  Your sample
would help us understand the default of MS.NET and fix the issue.


V. Varadhan

More information about the Mono-devel-list mailing list