Culture is not supported when deserializing file

Viewed 154

I'm trying to deserialize a file that was serialized from a system with a foreign culture. I am getting the following error, but I can't seem to get around it. Any pointers appreciated.

Culture is not supported. Parameter name: culture 3072 (0x0c00) is an invalid culture identifier.

Even trying to set the culture to any country does not change the error that culture 3072 is invalid.

var file = "C:\\myfile.blb"
CultureInfo ci = new CultureInfo("el-GR"); //Adding or removing this line does NOT change the error.
var fs = new FileStream(file, FileMode.Open);
try
{
    var format = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
    DataSet ds = format.Deserialize(fs) as DataSet;  //Exception thrown on THIS line
    ....
}
catch (Exception ex)
{
    throw ex;
}
0 Answers
Related