Serialize Obj from App A and Deserialize it from App B

A

Ahmad Jalil Qarshi

Hi!

I have two applications A and B.

I used the BinaryFormatter object to serialize and deserialize object of
Structure "st" in my Applicaion "A".

Now I tried to Deserialize that Object from application "B". It gave me
following error message.

[An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in
mscorlib.dll

Additional information: Cannot find the assembly A, Version=1.0.2240.32685,
Culture=neutral, PublicKeyToken=null.]

whereas I can easily read that Object in application "A".

when I opened the file that contain the serialized object I found that
application "A" placed its name as header while serializing object.

Any way to solve this problem.

Please note that I am serializing more than 1 objects in same file.

Regard,

Ahmad Jalil Qarshi
 
S

Steven Nagy

I dont know if this is the correct answer, but perhaps try declaring
your structure in a 3rd project, class library.
Have application A and B both reference the project and thus the
struct. See if that helps.
I am thinking along the lines of the dll assembly now being the same in
both solutions. Also perhaps could be a namespacing issue?
Give app A and B same Namespace if the above point doesn't work

I'm interested to know the solution if I am way off course.
 

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