473,724 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BinaryFormatter .Deserialize fails when used with .net ActiveX

Hi All,
I have an annoying trouble with binary serialization. I have a windows
forms application which works like a server and keeps sending data to its
clients. The data is serialized before being sent using BinaryFormatter and a
serializable object. When using a windows forms application as a client,
everything works just fine and deserialized data can be received intact. When
the client application is is embedded in Internet Explorer (I call it .net
ActiveX), the received data can not be deserialized correctly and I get the
following error:

System.Runtime. Serialization.S erializationExc eption
BinaryFormatter Version incompatibility . Expected Version 1.0. Received
Version 130568.28573900 8

Note that I'm using exactly the same code I use with the windows forms
application but, the result is completely different. I checked the
serializable object version deployed on the web server and the serializable
object used at the sending point, both are the same. I tried to write the
bytes received to a file stream and it looked normal to me. If someone of you
can help me, I will be very thankful.

Regards
Sep 26 '05 #1
5 3826
This problem occures when IIS returns a error page. Which is of course not
binary formatted. So on recieving the error page your deserializer throws an
error.

You may check the config file, there should be. binary not soap.
<formatter ref="binary"/>

Hope this helps
--
Rainier van Slingerlandt
Microsoft Certified Trainer in Software Development.

"aladdinm1" wrote:
Hi All,
I have an annoying trouble with binary serialization. I have a windows
forms application which works like a server and keeps sending data to its
clients. The data is serialized before being sent using BinaryFormatter and a
serializable object. When using a windows forms application as a client,
everything works just fine and deserialized data can be received intact. When
the client application is is embedded in Internet Explorer (I call it .net
ActiveX), the received data can not be deserialized correctly and I get the
following error:

System.Runtime. Serialization.S erializationExc eption
BinaryFormatter Version incompatibility . Expected Version 1.0. Received
Version 130568.28573900 8

Note that I'm using exactly the same code I use with the windows forms
application but, the result is completely different. I checked the
serializable object version deployed on the web server and the serializable
object used at the sending point, both are the same. I tried to write the
bytes received to a file stream and it looked normal to me. If someone of you
can help me, I will be very thankful.

Regards

Sep 27 '05 #2
Thanks for your fast response.
Unfortunately, this could not help in my case. This may help someone using
remoting through ASP.NET. This is not the situation here. The application I'm
using is Windows Forms application which runs on an HTML page. I suspected
the encoding of strings so, I removed them from my serializable object but,
still getting the same problem.

Regards

"Rainier" wrote:
This problem occures when IIS returns a error page. Which is of course not
binary formatted. So on recieving the error page your deserializer throws an
error.

You may check the config file, there should be. binary not soap.
<formatter ref="binary"/>

Hope this helps
--
Rainier van Slingerlandt
Microsoft Certified Trainer in Software Development.

"aladdinm1" wrote:
Hi All,
I have an annoying trouble with binary serialization. I have a windows
forms application which works like a server and keeps sending data to its
clients. The data is serialized before being sent using BinaryFormatter and a
serializable object. When using a windows forms application as a client,
everything works just fine and deserialized data can be received intact. When
the client application is is embedded in Internet Explorer (I call it .net
ActiveX), the received data can not be deserialized correctly and I get the
following error:

System.Runtime. Serialization.S erializationExc eption
BinaryFormatter Version incompatibility . Expected Version 1.0. Received
Version 130568.28573900 8

Note that I'm using exactly the same code I use with the windows forms
application but, the result is completely different. I checked the
serializable object version deployed on the web server and the serializable
object used at the sending point, both are the same. I tried to write the
bytes received to a file stream and it looked normal to me. If someone of you
can help me, I will be very thankful.

Regards

Sep 27 '05 #3

I discovered that before the Version incompatibility exception is thrown,
the BinaryFormatter can not find the serializable object assembly. I made
sure a thousand times that assembely of the serializable object is in the
same location as the web page and in its bin directory. I also made sure all
references are set. Also note that, I have other assemblies referenced by the
activex and they are working just fine. How can I tell the engine that I
really have the assembly deployed?

Regards

"aladdinm1" wrote:
Thanks for your fast response.
Unfortunately, this could not help in my case. This may help someone using
remoting through ASP.NET. This is not the situation here. The application I'm
using is Windows Forms application which runs on an HTML page. I suspected
the encoding of strings so, I removed them from my serializable object but,
still getting the same problem.

Regards

"Rainier" wrote:
This problem occures when IIS returns a error page. Which is of course not
binary formatted. So on recieving the error page your deserializer throws an
error.

You may check the config file, there should be. binary not soap.
<formatter ref="binary"/>

Hope this helps
--
Rainier van Slingerlandt
Microsoft Certified Trainer in Software Development.

"aladdinm1" wrote:
Hi All,
I have an annoying trouble with binary serialization. I have a windows
forms application which works like a server and keeps sending data to its
clients. The data is serialized before being sent using BinaryFormatter and a
serializable object. When using a windows forms application as a client,
everything works just fine and deserialized data can be received intact. When
the client application is is embedded in Internet Explorer (I call it .net
ActiveX), the received data can not be deserialized correctly and I get the
following error:

System.Runtime. Serialization.S erializationExc eption
BinaryFormatter Version incompatibility . Expected Version 1.0. Received
Version 130568.28573900 8

Note that I'm using exactly the same code I use with the windows forms
application but, the result is completely different. I checked the
serializable object version deployed on the web server and the serializable
object used at the sending point, both are the same. I tried to write the
bytes received to a file stream and it looked normal to me. If someone of you
can help me, I will be very thankful.

Regards

Sep 27 '05 #4
You are in a sandbox when deploying your application using (HTTP
No-Touch Deployment). I think you have to double check the path where
you are trying to deserialize/load the file from.

aladdinm1 wrote:
I discovered that before the Version incompatibility exception is thrown,
the BinaryFormatter can not find the serializable object assembly. I made
sure a thousand times that assembely of the serializable object is in the
same location as the web page and in its bin directory. I also made sure all
references are set. Also note that, I have other assemblies referenced by the
activex and they are working just fine. How can I tell the engine that I
really have the assembly deployed?

Regards

"aladdinm1" wrote:

Thanks for your fast response.
Unfortunately , this could not help in my case. This may help someone using
remoting through ASP.NET. This is not the situation here. The application I'm
using is Windows Forms application which runs on an HTML page. I suspected
the encoding of strings so, I removed them from my serializable object but,
still getting the same problem.

Regards

"Rainier" wrote:

This problem occures when IIS returns a error page. Which is of course not
binary formatted. So on recieving the error page your deserializer throws an
error.

You may check the config file, there should be. binary not soap.
<formatter ref="binary"/>

Hope this helps
--
Rainier van Slingerlandt
Microsoft Certified Trainer in Software Development.

"aladdinm1 " wrote:
Hi All,
I have an annoying trouble with binary serialization. I have a windows
forms application which works like a server and keeps sending data to its
clients. The data is serialized before being sent using BinaryFormatter and a
serializabl e object. When using a windows forms application as a client,
everythin g works just fine and deserialized data can be received intact. When
the client application is is embedded in Internet Explorer (I call it .net
ActiveX), the received data can not be deserialized correctly and I get the
following error:

System.Runt ime.Serializati on.Serializatio nException
BinaryForma tter Version incompatibility . Expected Version 1.0. Received
Version 130568.28573900 8

Note that I'm using exactly the same code I use with the windows forms
applicati on but, the result is completely different. I checked the
serializabl e object version deployed on the web server and the serializable
object used at the sending point, both are the same. I tried to write the
bytes received to a file stream and it looked normal to me. If someone of you
can help me, I will be very thankful.

Regards

Sep 27 '05 #5

I'm not loading assembly manually. It's loaded on behalf of BinaryFormatter
and I have no control on where it loads file from. All binary files all
deployed to web server root directory. All assemblies get loaded successfully
but, the one being loaded by the BinaryFormatter does not get loaded
successfully.

Regards

"Collin Bennett" wrote:
You are in a sandbox when deploying your application using (HTTP
No-Touch Deployment). I think you have to double check the path where
you are trying to deserialize/load the file from.

aladdinm1 wrote:
I discovered that before the Version incompatibility exception is thrown,
the BinaryFormatter can not find the serializable object assembly. I made
sure a thousand times that assembely of the serializable object is in the
same location as the web page and in its bin directory. I also made sure all
references are set. Also note that, I have other assemblies referenced by the
activex and they are working just fine. How can I tell the engine that I
really have the assembly deployed?

Regards

"aladdinm1" wrote:

Thanks for your fast response.
Unfortunately , this could not help in my case. This may help someone using
remoting through ASP.NET. This is not the situation here. The application I'm
using is Windows Forms application which runs on an HTML page. I suspected
the encoding of strings so, I removed them from my serializable object but,
still getting the same problem.

Regards

"Rainier" wrote:
This problem occures when IIS returns a error page. Which is of course not
binary formatted. So on recieving the error page your deserializer throws an
error.

You may check the config file, there should be. binary not soap.
<formatter ref="binary"/>

Hope this helps
--
Rainier van Slingerlandt
Microsoft Certified Trainer in Software Development.

"aladdinm1 " wrote:
>Hi All,
> I have an annoying trouble with binary serialization. I have a windows
>forms application which works like a server and keeps sending data to its
>clients. The data is serialized before being sent using BinaryFormatter and a
>serializabl e object. When using a windows forms application as a client,
>everythin g works just fine and deserialized data can be received intact. When
>the client application is is embedded in Internet Explorer (I call it .net
>ActiveX), the received data can not be deserialized correctly and I get the
>following error:
>
>System.Runt ime.Serializati on.Serializatio nException
>BinaryForma tter Version incompatibility . Expected Version 1.0. Received
>Version 130568.28573900 8
>
>Note that I'm using exactly the same code I use with the windows forms
>applicati on but, the result is completely different. I checked the
>serializabl e object version deployed on the web server and the serializable
>object used at the sending point, both are the same. I tried to write the
>bytes received to a file stream and it looked normal to me. If someone of you
>can help me, I will be very thankful.
>
>Regards

Sep 27 '05 #6

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

Similar topics

2
3807
by: Dominic | last post by:
Hi everybody, In my application, I'm planning to use BinaryFormatter to serialize a potentially huge object to file (and, of course, deserialize back to memory later). My question is if there is any hard limit on the size of this object? Is it only limited by the amount of memory or hard-disk space in the server?
0
1055
by: aladdinm1 | last post by:
Hi All, Reference to the problem I posted with subject "BinaryFormatter.Deserialize fails when used with .net ActiveX". I could successfully solve the problem by creating a class inherited from SerializationBinder and setting the Binder property of the BinaryFormatter to an instance of that class. The code used was just one line to return the type used to serialize data. I got this information by help of the following Url: ...
3
5480
by: Joshua Moore | last post by:
I have a webservice that serializes a ton of variables and other good stuff to a txt file using SoapFormatter (IFormatter), and when I try to deserialize it using the binary formatter, i get the following error: BinaryFormatter Version incompatibility. Expected Version 1.0. Received Version 1986938170.1886350437. I've read a lot about this error from several sources on the net, but can't
0
1768
by: Fred Heida | last post by:
Hi Al, i have a funny problem.. i you can call it funny.. what i have is 2 assemblies, the first one does nothing other then Application.Run(new MyForm())
11
3953
by: Igor | last post by:
Hi. While executing BinaryFormatter.Deserialize() I get: System.InvalidCastException: Specified cast is not valid. I implemented ISerializable interface. What may be a problem? Thanks.
2
2730
by: Henrik Skak Pedersen | last post by:
Hello, I have a class which is beeing serialized/deserialized using the BinaryFormatter class. That has been working with no problems until I signed all my assemblies. Now I get a SerializationException when I try to Deserialize the class which has been serialized before the signing. So what is best practice in my situation? Do I have to convert all my saved classes or do I write a SerializationBinder to handle it runtime?
0
2075
by: Fruber Malcome | last post by:
I'm getting a very weird exception and hoping someone may be able to help. I have an Office Add-In that lives in a .dll (for email reference ai.dll) ai.dll makes calls into the core part of the application implementation in another .dll (let's call that app.dll). app.dll makes a function call into another dll (let's call that one dep.dll). dep.dll has some code in it where it deserializes a memorystream using a binaryformatter.
19
6240
by: Sharon | last post by:
Hi, When I'm doing BinaryFormatter.Deserialize() over a TCP socket. When I'm closing the TcpListener by invoking the TcpListener.Stop(); I get: System.IO.IOException with message "Unable to read data from the transport connection." that InnerException of type System.Net.Sockets.SocketException saying "An established connection was aborted by the software in your host machine".
5
236
by: aladdinm1 | last post by:
Hi All, I have an annoying trouble with binary serialization. I have a windows forms application which works like a server and keeps sending data to its clients. The data is serialized before being sent using BinaryFormatter and a serializable object. When using a windows forms application as a client, everything works just fine and deserialized data can be received intact. When the client application is is embedded in Internet Explorer (I...
0
8868
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
9388
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
9241
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
9160
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
9090
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
8062
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
6685
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
5996
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();...
3
2149
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.