By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,906 Members | 1,715 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,906 IT Pros & Developers. It's quick & easy.

Serialization of data for two or more executables

P: n/a
ven
I have used C# binary formatter to serialize and
deserialize a data structure. However, for the same data
format( used by the first executable, the same *.CS
files), the second executable gives an error referring to
the first assembly name missing, when trying to
deserialize the *.dat file. When I rename the second
executable to the first executable, it works fine. the
*.dat file was created by the first executable.

Could any one help me, what I am missing ?
Thanks in advance.
ven
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ven
Rephrasing my question, is there a way to deserialize
objects Serialized by another assembly/exe. I have two
different executables which use same *.dat file to
communicate.
Previously I had no problem in developing stage as i was
building them from the same project directory and
selecting manually different main entry points and
renaming the executables as different names.

As I have seperated in the Release version the two
executables as seperate project one cannot read the
other's *.dat file expecting the others assembly as
missing.
Is there a way to get around this problem ?

Thanks in advance. Any pointers would be appreciated ..
-----Original Message-----
I have used C# binary formatter to serialize and
deserialize a data structure. However, for the same data
format( used by the first executable, the same *.CS
files), the second executable gives an error referring to
the first assembly name missing, when trying to
deserialize the *.dat file. When I rename the second
executable to the first executable, it works fine. the
*.dat file was created by the first executable.

Could any one help me, what I am missing ?
Thanks in advance.
ven
.

Nov 15 '05 #2

P: n/a
the "textbook" way do accomplish what you are asking is
(i believe) to deserialize using SerializationBinder, an
example of this is published in
msdn.microsoft.com/library/en-
us/cpref/html/frlrfsystemruntimeserializationserialization
binderclasstopic.asp

But your question brings up a different issue: is there
a way to surpress assemly information in the
serialization produced by BinaryFormatter? the docs
suggest that BinaryFormatter is suitable for objects
shared by multiple apps, for instance on the clipboard--
but if this is the case the clipboard object shouldn't be
tied to any particular assembly (should it?). similarly,
it seems like serialization using BinaryFormatter would
produce a reasonable candidate for an application
independent file format (say ".mySpiffyJpeg"), but you
probably wouldnt want a file format like this tied to a
specific assembly.

does anyone have comments on whether BinaryFormatter was
designed to be used for assembly-independent purposes
such as clipboard or file formats?

-----Original Message-----
Rephrasing my question, is there a way to deserialize
objects Serialized by another assembly/exe. I have two
different executables which use same *.dat file to
communicate.
Previously I had no problem in developing stage as i was
building them from the same project directory and
selecting manually different main entry points and
renaming the executables as different names.

As I have seperated in the Release version the two
executables as seperate project one cannot read the
other's *.dat file expecting the others assembly as
missing.
Is there a way to get around this problem ?

Thanks in advance. Any pointers would be appreciated ..
-----Original Message-----
I have used C# binary formatter to serialize and
deserialize a data structure. However, for the same dataformat( used by the first executable, the same *.CS
files), the second executable gives an error referring tothe first assembly name missing, when trying to
deserialize the *.dat file. When I rename the second
executable to the first executable, it works fine. the
*.dat file was created by the first executable.

Could any one help me, what I am missing ?
Thanks in advance.
ven
.

.

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.