Win10 Home, lang=Swedish, NT8.0.16.3, VS2017, .NET4.7
Problem:
When serializing and deserializing (a custom type/list = PriceBars : IList<PriceBar>) with the bellow code (targeting .NET 4.7) in VS2017 everything works fine.
When serializing the same type/list with the exact same code in NT8 I get an exception when deserializing it in the same VS project as above.
Exception:
system.runtime.serialization.serializationexceptio n: unable to find the assembly d04d3a...... version 8.0.16.3, Culture=neutral... (se encl pic)
Question:
The serializer namespace resides in System.Core.Dll. But the thrown exception refers to an strange assembly with a version number identical the the NT8 version. Any clue what´s going on here? Is NT8 referencing a different System.Core.Dll assembly than VS2017?
{
// paths
string folderPath = System.Environment.GetFolderPath(Environment.Speci alFolder.MyDocuments);
string filePath = folderPath + @"\NTprices2.cfe";
// Open a stream for writing.
FileStream fs = new FileStream(filePath, FileMode.Create);
// Construct a BinaryFormatter
BinaryFormatter bf = new BinaryFormatter();
try
{
bf.Serialize(fs, priceBars);
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
throw;
}
finally
{
fs.Close();
}
}
Comment