473,382 Members | 1,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Serialization of data for two or more executables

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
2 1814
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Ben | last post by:
Hi, there. Recently I was working on a problem where we want to save generic closures in a data structure (a vector). The closure should work for any data type and any method with pre-defined...
1
by: Mountain Bikn' Guy | last post by:
We have an app that computes a lot of numeric data. We would like to save to disk about 1-2 gigabytes of computed data that includes ints, doubles, strings and some complex objects that contain...
2
by: Dave Veeneman | last post by:
I'm working on a project where I have to persist data to a file, rather than to a database. Basically, I need to save the state of several classes, each of which will have a couple of dozen...
4
by: Brian Keating | last post by:
wonder if anyone can help me here, i've a framework 1.1 dataset which i serialize in framework 1.1 and deserialize in framework 2.0. This is fine, problem is that i want to modify some of the...
0
by: nickdu | last post by:
We have the need to persist data to a configuration database. We want the format of this data to be XML. There are two approaches that come to mind that seem to fit the bill. Below are the two...
2
by: Bart | last post by:
Hi, i read several articles about serialization. I know now that it is a process of converting an object into a stream of data so that it can be is easily transmittable over the network or can...
11
by: William | last post by:
I'm looking for an example that would show how to serialize a c++ object at it's simplest w/o using any other api's. I have a class that I want to serialize and then pass to my obj-c class so I can...
2
by: Peter Duniho | last post by:
I've been learning about mechanisms .NET offers to export data. The initial goal is to see what sorts of ways are available to save an application's state (document, internal database, whatever). ...
2
by: mkvenkit.vc | last post by:
Hello, I hope this is the right place to post a question on Boost. If not, please let me know where I can post this message and I will do so. I am having a strange problem with std::string as...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.