Serializating / Deserializating from different apps

G

Guest

Hi all,

I got a really bad headache with this exception. I have a class named
THECLASS which implements two static methods to provide externalization of
the object itself. One method is LOAD from file (deserializing) and the other
one is SAVE to file (Serializing). This class is in a DLL apart.

Ok, now i have a an app (called App1), from wich i call the SAVE method of
the object. Everything goes fine, and the object gets serialized into a file.
If i try to deserialize the object from App1, it gets deserialized without
problems, as seen here:

//Serialization in App1:
THECLASS c1=new THECLASS();
c1.SAVE(file); // -> OK!

//Deserialization in App1:
THECLASS c2=THECLASS.LOAD(file); -> OK!

NOW THE PROBLEM:

If i try to deserialize the object in another app, named App2, i get a
SerializationException with the message: Can't find the assembly App1

//In App2:
THECLASS c3=THECLASS.LOAD(file); -> SerializationException!!

Of course, THECLASS is in a DLL apart, referenced in both App1 and App2.

I dont know whats going on! PLEASE HELP!!!

Thanks in advance,

Mauri.
 
G

Guest

OK Now i know what was happening: The problem was that THECLASS had two
events, suscribed to App1. If i desuscribe them before serializing, the
problem dissapears!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top