找不到总成找不到、总成

2023-09-05 02:50:03 作者:触及

我序列化一个ArrayList到一个二进制文件,以便它通过TCP / IP发送。序列化的文件由服务器创建的,我希望能够用我正在写此刻的客户端反序列化。

I'm Serializing an ArrayList to a binary file in order to send it across TCP/IP. The serialized file is created by the server and I hope to be able to deserialize it with the client that I'm writing at the moment.

然而,当客户端尝试反序列化,它抛出一个SerializationException,因为它无法找到组件(presumably)的连载开始与文件。

However, when the client attempts to deserialize it throws a SerializationException because it can't find the assembly (presumably) which serialized the file to begin with.

我如何解决这个问题呢?

How do I get around this?

推荐答案

贵ArrayList中包含自定义数据类型(比如你所在的班级)?

Does your arraylist contain custom data type (i.e. your own classes)?

ArrayList中不会被反序列化,除非code运行反序列化可以访问所有包含在数组列表中的类。

The arraylist won't be deserialized unless the code running the deserialize has access to all of the classes contained within the arraylist.