473,407 Members | 2,312 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,407 software developers and data experts.

serializing

Hello NG,

Im Trying to save some App Data by De-/ Serializing an Object:

Public Function DeSerializeFromByte(ByVal Bytes As Byte()) as
SerializableClass
Dim myObject As SerializableClass
Dim mySerializer As
System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter = New
System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter()
Dim myMemoryStream As System.IO.MemoryStream = New
System.IO.MemoryStream(Bytes)
myObject = CType(mySerializer.Deserialize(myMemoryStream),
SerializableClass)
myMemoryStream.Close()
Return myObject
End Function

My Problem is, that I have 2 Applications with different Assembly Names. If
I Serialize the Object in App1 then I get an Exception in App2, if I try to
DeSerialize it.

Does anybodey Know how I can DeSerialize a Binary (by not using XML) File to
another Application?

Thanks

Niels Wiederanders
Mar 6 '07 #1
1 994
Niels,

The most simple one I know

http://www.vb-tips.com/dbpages.aspx?...c-61641f5c8d9d

Be aware this works only for serializable classes. The arraylist is that
already. To make your class serializable just add the tag.

Cor

"Niels Wiederanders" <pa*****@gmx.deschreef in bericht
news:es*************@news.t-online.com...
Hello NG,

Im Trying to save some App Data by De-/ Serializing an Object:

Public Function DeSerializeFromByte(ByVal Bytes As Byte()) as
SerializableClass
Dim myObject As SerializableClass
Dim mySerializer As
System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter = New
System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter()
Dim myMemoryStream As System.IO.MemoryStream = New
System.IO.MemoryStream(Bytes)
myObject = CType(mySerializer.Deserialize(myMemoryStream),
SerializableClass)
myMemoryStream.Close()
Return myObject
End Function

My Problem is, that I have 2 Applications with different Assembly Names.
If I Serialize the Object in App1 then I get an Exception in App2, if I
try to DeSerialize it.

Does anybodey Know how I can DeSerialize a Binary (by not using XML) File
to another Application?

Thanks

Niels Wiederanders

Mar 7 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ryan Hubbard | last post by:
I've have been trying to serialize an array of objects. I can serialize and set a session variable and retrieve it successfully for a serialize string of any length within the contents of a single...
2
by: Aleksei Guzev | last post by:
Imagine one writing a class library CL1 for data storage. He defines classes ‘DataItem’ and ‘DataRecord’ so that the latter contains a collection of the former. And he derives class ‘IntItem’ from...
1
by: Ivo Bronsveld | last post by:
All, I have quite a challenging task ahead of me. I need to write an object model (for code access) based on a schema, which cannot be made into a dataset because of it's complexity. So I...
10
by: copx | last post by:
I want to save a struct to disk.... as plain text. At the moment I do it with a function that just writes the data using fprintf. I mean like this: fprintf(fp, "%d %d", my_struct.a, my_struct.b)...
1
by: Chris | last post by:
I'm having trouble Serializing a System.Data.DataColumn object. When I try to serialize it, I get the following: System.NotSupportedException: Cannot serialize member...
2
by: Tobias Zimmergren | last post by:
Hi, just wondering what serializing really is, and howto use it? Thanks. Tobias __________________________________________________________________ Tobias ICQ#: 55986339 Current ICQ status: +...
4
by: Jason Shohet | last post by:
We are thinking of serializing an object & passing it toseveral functions on web service. This will happen about 35 times as the page loads. The class has about 20 attributes. We're not sure...
2
by: Simon | last post by:
I'm developing a new application and want to use serialization as a way to save my data. But as I add new variables to my classes, how will serializing cope with that? For example, suppose I have...
7
by: fjlaga | last post by:
I have written an Office Add-in for Excel using VB.NET and the .NET 1.1 Framework (I have Visual Studio 2003 .NET ). All works great. I want to add a User Settings/Prefereneces dialog and allow...
12
by: Cagdas Ozgenc | last post by:
Greetings, When directly serializing C++ structures to a file with the standard library functions giving the address of the data and length of structure using the sizeof operator, do I risk...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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,...
0
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...

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.