473,652 Members | 2,965 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 1304

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
5558
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
8704
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
8470
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
8590
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5620
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
4147
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
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
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
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
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.