异常:内存位置的EEFileLoadException

时间:2013-10-15 16:59:14

标签: c# exception

我启用所有异常,并获得这个奇怪的异常:

  

MyApp.exe中的0x773ac41f的第一次机会异常:Microsoft C ++   异常:内存位置0x0038c23c的EEFileLoadException ..

“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();
    }
}

0 个答案:

没有答案