So I have a serialized binary file with some contents in it and I'm trying to deserialize it.
I have:
try
{
using (Stream stream = File.Open(file, FileMode.Open))
{
BinaryFormatter bin = new BinaryFormatter();
var contents = bin.Deserialize(stream);
}
}
catch (IOException io)
{
Debug.LogError(io.ToString());
}
But I get an IO Exception
System.IO.FileNotFoundException: Could not load file or assembly 'Packaging Tool, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'Packaging Tool, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
That's the start of the file itself. I tried it in a console application and it works perfectly, but when I import it into Unity3D, things get messy. Does someone know where the root of the problem may be?
Also, when I comment the line with bin.Deserialize, the exception disappears.