473,654 Members | 3,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb.net binary serialization fails

Sorry if my english sucks, it's not my native language.
I'm stuck with following problem:
I have two vb.net (2003) applications, first one makes a list ofwords and their occurrence:
Dim formatter As NewSystem.Runti me.Serializatio n.Formatters.Bi nary.BinaryForm atter
Dim fstream As New System.IO.FileS tream _
(txtPath.Text, IO.FileMode.Cre ate)

formatter.Seria lize(fstream, wordlist)
fstream.Close()

and other program tries to read a produced file to same kind ofstructure:

Dim formatter As NewSystem.Runti me.Serializatio n.Formatters.Bi nary.BinaryForm atter
Dim fstream As New System.IO.FileS tream _
(Application.St artupPath & "\index.bin",IO .FileMode.Open, IO.FileAccess.R ead)

wordlist = CType(formatter .Deserialize(fs tream),ArrayLis t)
fstream.Close()
I have defined in both programs:
<Serializable() > Public Class cWordInfo
Public word As String
Public files() As String
End Class

Public wordlist As New ArrayList

Now the problem is that apparently binaryformatter serializesalso some assembly-information, and my reader program (actualproduct) can't read a file because of assembly conflict? Have Iunderstood correctly, and if so, how do I fix the problem? Iwouldn't like to start hacking assembly-information, but do thisserializati on nicely from code. How should I proceed? The file Icreate with my tool-program is about 3 megabytes, and file withxml-serialization (witch I did get to work) is about 15megabytes, and that's not an acceptable filesize, it takes toomutch time to load. I'm not trying to send the file over thenetwork, it's all in one computer.

You can see reader-program's error message at:
http://www.esakom.net/ongelma.gif

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>QsFlSq2cVEC b+81OHGwxLQ==</Id>
Jul 21 '05 #1
0 1305

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

Similar topics

9
6508
by: Ching-Lung | last post by:
Hi all, I try to create a tool to check the delta (diff) of 2 binaries and create the delta binary. I use binary formatter (serialization) to create the delta binary. It works fine but the delta binary is pretty huge in size. I have 1 byte file and 2 bytes file, the delta should be 1 byte but somehow it turns out to be 249 bytes using binary formatter. I guess serialization has some other things added to the delta file.
2
7800
by: phyzics | last post by:
I am porting an application from C++ to C#, and am having trouble finding a way to quickly and efficiently write structures to a binary file. In C++ this is trivial because all that is necessary is to pack the structure to 1 byte boundries, and then just write out the structure directly to the File IO function pragma pack (1 typedef struct char var1 int var1 }MyStruc fwrite(&myStructure,sizeof(MyStruct),1,filepointer);
2
6648
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...
11
11945
by: ajou_king | last post by:
I was running some tests on my Win32 1GHZ processor to see how long it would take to transmit objects numerous times via TCP/IP using C# ..NET Remoting vs the C++ trustworthy method of binary streams. I ran the test for 50K, 100K, 500K iterations, where each iteration consists of sending an object from a client process to a server process, and the server process sends back an ack. Here are the results: .NET Remoting C++...
7
9551
by: schoenfeld1 | last post by:
I've implemented IPC between two applications using named pipes and binary serialization, but have noticed that the binary formatter is rather slow. It seems that the binary formatter reflects the entire type everytime it is invoked to serialize/deserialize an object of that type. Is there a way to prepare the binary formatter with a pre-defined type, such that it only reflects once but can be re-used to serialize/deserialize objects...
0
328
by: Esa Komulainen via .NET 247 | last post by:
Sorry if my english sucks, it's not my native language. I'm stuck with following problem: I have two vb.net (2003) applications, first one makes a list ofwords and their occurrence: Dim formatter As NewSystem.Runtime.Serialization.Formatters.Binary.BinaryFormatter Dim fstream As New System.IO.FileStream _ (txtPath.Text, IO.FileMode.Create) formatter.Serialize(fstream, wordlist) fstream.Close()
1
11091
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
2
5559
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...
1
5386
by: sandeepbhutani304 | last post by:
have 2 projects communicating each other with .NET remoting. But when I am trying to call these functions I am getting the error: The input stream is not a valid binary format. The starting contents (in bytes) are: 53-79-73-74-65-6D-2E-54-79-70-65-4C-6F-61-64-45-78 ...
0
8379
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8294
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8709
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...
0
7309
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
6162
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
4150
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...
2
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1597
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.