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

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.SerializationExceptio n
BinaryFormatter Version incompatibility. Expected Version 1.0. Received
Version 130568.285739008

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 3766
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.SerializationExceptio n
BinaryFormatter Version incompatibility. Expected Version 1.0. Received
Version 130568.285739008

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.SerializationExceptio n
BinaryFormatter Version incompatibility. Expected Version 1.0. Received
Version 130568.285739008

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.SerializationExceptio n
BinaryFormatter Version incompatibility. Expected Version 1.0. Received
Version 130568.285739008

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
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.SerializationExce ption
BinaryFormatter Version incompatibility. Expected Version 1.0. Received
Version 130568.285739008

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 #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
>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.SerializationExce ption
>BinaryFormatter Version incompatibility. Expected Version 1.0. Received
>Version 130568.285739008
>
>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 #6

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

Similar topics

2
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...
0
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...
3
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...
0
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
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
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...
0
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...
19
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...
5
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.