I have little understanding problem with XMLSerialiyer.
It seams to be the way, that a serialized object can not be deserialized again if serialization and deserialization are called fromassemblies which are identical, but physically located on different paths. The following code shows the deserialization:
using (FileStream fs = new FileStream(settingsPath, FileMode.Open))
XmlSerializer serializer = new XmlSerializer(typeof(MySettings));
object o = serializer.Deserialize(fs);
instance = o as MySettings;
The strange part is, that the object o shows all the properties of the MySettings class (in the debugger), but when I try to assign "o as MySettings" to
instance instance stays null . So actually the deserialization seems to work, but the typcasting not.
Every thing works fine as long as it is the same application that created the xml file deserializes it. But in my case, where I wrote a test, using the same assemblys (partially loaded at runtime) then the application later on will show the described faulty
What could be the cause to my problem?
View Complete Post