473,776 Members | 1,540 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 3831
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
3808
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
5481
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
1771
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
3958
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
2731
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
2078
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
6248
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
10287
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
10119
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
10060
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
9922
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
8951
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...
0
6721
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
5492
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4030
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
3621
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.