Hi,
I'm having problems deploying a project to win2003.
It is currently on win2000 server and works fine - it also works fine
on my development machine - win2003.
Both my machine and the new machine are running .net 1.1 sp1.
I get an error when I try to descrialize a file (with code):
XmlTextReader reader = new XmlTextReader(fileName);
blob = (CustomClass) serializer.Deserialize(reader); //error
Error is of type: InvalidCastException,
so I re-ran the code with:
object o = (object) serializer.Deserialize (reader);
blob = (CustomClass) serializer.Deserialize (reader); //error
and it deserializes ok, but get an error on the cast, still.
I then embedded the .xml file, and read from the assembly, just to make
sure it had nothing to do with filesystem permissions, etc., and still
won't work.
I also run:
serializer.CanDeserialize(reader)
each time (before deserializing) and it returns a true value.
The custom class is of the form:
public class CustomClass
{
public CustomClass() {}
/// <summary>
/// informative name of the configuration file
/// </summary>
[XmlAttribute]
public string Name;
[XmlElement(ElementName="ABC")]
public Country[] ABC;
}
public class Country
{
[XmlAttribute]
public string CountryDescription;
[XmlAttribute]
public string Value;
}
and the .xml file is:
<?xml version="1.0" encoding="utf-8" ?>
<HyperionConfiguration Name="bnp">
<ABC CountryDescription="United Arab Emirates" Value="ae"/>
<ABC CountryDescription="Antilhas" Value="an"/>
<ABC CountryDescription="Argentina" Value="ar"/>
<ABC CountryDescription="Austria" Value="at"/>
<ABC CountryDescription="Australia" Value="au"/>
</HyperionConfiguration>
Does anybody have any Ideas?
I'd really appreciate any clues!
rgds
pb