I am using WriteXML/ReadXml pair to save DataSet for later use. DataSet
is built by reading textfiles and storing their data to different
DataTables. Each file contains several complex values, that are
represented using a DataValue object. DataValue is an abstract class,
that has subclasses that implement the value (for example; ValBlkValue
represents a vector of floating values).
Class DataValue implements IXmlSerializable interface and each subclass
implements WriteXml and ReadXml methods that write or read the value to
the XML file.
This works fine, but XML file contains strong name of the class; for
example:
....
<value msdata:InstanceType="Dmt.GUI.DmtDatasetImport+ValB lkValue,
vmtedit-dmt, Version=1.1.3033.18571, Culture=neutral,
PublicKeyToken=18990d3c7fd98be6"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<ValBlkValue datakind="valblkKind" count="9776" len="9">
<vbv>545.8157959</vbv>
<vbv>6.93030977</vbv>
<vbv>44.65736008</vbv>
<vbv>-12.41137695</vbv>
<vbv>-8.45540428</vbv>
<vbv>5.44249964</vbv>
<vbv>-7.45017338</vbv>
<vbv>0</vbv>
<vbv>0</vbv>
</ValBlkValue>
</value>
When I compile new version of the program, ReadXml (actually
ReadXmlSchema, since I tried to put the schema to a separate file) crashes:
ERROR 1 Dmt.GUI.DmtDatasetImport - error reading file: Could not load
file or assembly 'vmtedit-dmt, Version=1.1.3033.18571, Culture=neutral,
PublicKeyToken=18990d3c7fd98be6' or one of its dependencies. The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)
So, how can I make either the XmlSerializer not to put the full
classname, or make it ignore small differences in versions?
--
Arto Viitanen
Tampere, Finland