【发布时间】:2013-09-23 00:05:52
【问题描述】:
所以我有一个包含一些内容的序列化二进制文件,我正在尝试反序列化它。
我有:
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());
}
但是我得到一个 IO 异常
System.IO.FileNotFoundException:无法加载文件或程序集 '打包工具,版本=1.0.0.0,文化=中性, PublicKeyToken=null' 或其依赖项之一。系统无法 找到指定的文件。文件名:'打包工具,版本=1.0.0.0, Culture=neutral, PublicKeyToken=null'
这是文件本身的开始。我在控制台应用程序中尝试过,它运行良好,但是当我将它导入 Unity3D 时,事情变得一团糟。有人知道问题的根源可能在哪里吗?
另外,当我用 bin.Deserialize 注释该行时,异常消失了。
【问题讨论】:
标签: c# .net binary unity3d deserialization