473,779 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1835
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 SerializationBi nder, an
example of this is published in
msdn.microsoft. com/library/en-
us/cpref/html/frlrfsystemrunt imeserializatio nserialization
binderclasstopi c.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
5021
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 signature. When developing this lib, I figured that the pointer-to-member-function, although seemingly an attractive solution, does not work well for us.
1
4255
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 hashtables. We would like to read this data back into the app and reuse those values and state to compute more new data. Up to this point we just write out comma separated ASCII values for everything. And we read/parse the ascii back in. The ASCII...
2
6653
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 instances. I have set it up to use binary serialization to a single file, which works well. However, I have learned that changes to my classes break the old serialized files. While my object model is pretty stable, I am concerned that using binary...
4
7487
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 records in framework 2.0 and serialize the data so framework 1.1 can deserialize it and do what it required. Is this possible?
0
1227
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 approaches I'm referring to. Note that I do list what I think are the pros and cons of each approach. 1. .NET Serialization. We could create classes which can participate in .NET serialization. Since we want the format of the persisted data to...
2
1345
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 be continued in a persistent storage location and that the serializable tag before the class makes the class serializable. Now i did some tests in order to understand it better, based on a example i found in the Wrox book "beginning asp.net 2.0".
11
3694
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 send it over the wire. I'm just looking for how to serialize it, then pack it back up on the other end. Any help much appreciated.
2
3847
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). Not counting storing data in a database (which is obviously suitable for some things, but not necessary or even necessarily desirable for other things), here's what I've explored: Serializable attribute, with BinaryFormatter and SoapFormatter...
2
5568
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 I am trying to read from a binary archive using Boost serialization. I am new to this, and it is possible that I have not understood the usage. In the code below, the string "faultblock" seems to be causing the problem. The code crashes in the ia...
0
10137
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8959
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7483
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.