I enable all exceptions, and get this weird exception:
First-chance exception at 0x773ac41f in MyApp.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x0038c23c..
the issue in "System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(T));"
public T GetObjectFromFile(string fileFullPath)
{
if (System.IO.File.Exists(fileFullPath) == false)
{
return default(T);
}
System.IO.StreamReader file = new System.IO.StreamReader(fileFullPath);
try
{
System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(T));
return (T)reader.Deserialize(file);
}
catch
{
return default(T);
}
finally
{
file.Close();
}
}