Click here to Skip to main content
16,010,918 members
Home / Discussions / C#
   

C#

 
GeneralRe: Display Image in ListView ! Pin
leppie5-Aug-04 19:55
leppie5-Aug-04 19:55 
GeneralRe: Display Image in ListView ! Pin
Colinyin5-Aug-04 20:07
Colinyin5-Aug-04 20:07 
GeneralRe: Display Image in ListView ! Pin
Looney Tunezez6-Aug-04 4:40
Looney Tunezez6-Aug-04 4:40 
QuestionWhy the web browser's IHTMLElementCollection.Lenght became 0 after change the designMode property? Pin
BeiJing20085-Aug-04 16:20
BeiJing20085-Aug-04 16:20 
Questioncustom control/list view ? Pin
Christian Graus5-Aug-04 14:00
protectorChristian Graus5-Aug-04 14:00 
AnswerRe: custom control/list view ? Pin
leppie5-Aug-04 19:59
leppie5-Aug-04 19:59 
GeneralRe: custom control/list view ? Pin
Christian Graus8-Aug-04 10:20
protectorChristian Graus8-Aug-04 10:20 
GeneralSerializationException when deserialize an object Pin
pelos5-Aug-04 13:35
pelos5-Aug-04 13:35 
hello,

I have developed a web service. The server (web service)serializes an object (a struct) via BinaryFormatter and then returns it to the client.
The client receives the serializated object and tries to deserialize it. This throws the following exception:

System.Runtime.Serialization.SerializationException:
Bynary stream does not contain a valid BinaryHeader, 0 possible causes, invalid stream or object version change between serialization and deserialization.

Here is the code:

serialization:
<br />
MemoryStream ms = new MemoryStream();<br />
BinaryFormatter bf = new BinaryFormatter();<br />
bf.Serialize(ms,myStruct);<br />
byte[] bArray = ms.GetBuffer();<br />
ms.Close();<br />


deserialization:
<br />
MemoryStream ms = new MemoryStream(bArray);<br />
BinaryFormatter bf =new BinaryFormatter();<br />
ms.Position = 0;<br />
myStruct struct =(myStruct)bf.Deserialize(ms);<br />
ms.Close();<br />


Do you know what is happening?

thank you.
GeneralRe: SerializationException when deserialize an object Pin
leppie5-Aug-04 20:04
leppie5-Aug-04 20:04 
GeneralRe: SerializationException when deserialize an object Pin
pelos5-Aug-04 21:23
pelos5-Aug-04 21:23 
GeneralRe: SerializationException when deserialize an object Pin
Heath Stewart6-Aug-04 5:13
protectorHeath Stewart6-Aug-04 5:13 
GeneralRe: SerializationException when deserialize an object Pin
pelos5-Aug-04 23:46
pelos5-Aug-04 23:46 
GeneralRe: SerializationException when deserialize an object Pin
pelos6-Aug-04 1:52
pelos6-Aug-04 1:52 
GeneralContainer Object reference in Contained class Pin
idoonii5-Aug-04 12:37
sussidoonii5-Aug-04 12:37 
GeneralRe: Container Object reference in Contained class Pin
leppie5-Aug-04 20:05
leppie5-Aug-04 20:05 
GeneralRe: Container Object reference in Contained class Pin
isamir6-Aug-04 5:45
isamir6-Aug-04 5:45 
GeneralRe: Container Object reference in Contained class Pin
Heath Stewart6-Aug-04 1:36
protectorHeath Stewart6-Aug-04 1:36 
Generalcopy NTF File Permission Pin
Anonymous5-Aug-04 11:11
Anonymous5-Aug-04 11:11 
GeneralRe: copy NTF File Permission Pin
Heath Stewart5-Aug-04 11:48
protectorHeath Stewart5-Aug-04 11:48 
GeneralRe: copy NTF File Permission Pin
Dave Kreskowiak6-Aug-04 3:25
mveDave Kreskowiak6-Aug-04 3:25 
GeneralReflection and System.Windows.Forms.Form Pin
Wizard_015-Aug-04 8:25
Wizard_015-Aug-04 8:25 
GeneralRe: Reflection and System.Windows.Forms.Form Pin
Heath Stewart5-Aug-04 8:37
protectorHeath Stewart5-Aug-04 8:37 
GeneralRe: Reflection and System.Windows.Forms.Form Pin
Wizard_015-Aug-04 13:47
Wizard_015-Aug-04 13:47 
GeneralRe: Reflection and System.Windows.Forms.Form Pin
Heath Stewart6-Aug-04 1:33
protectorHeath Stewart6-Aug-04 1:33 
GeneralSetting the System Cursor Pin
betterc5-Aug-04 8:16
betterc5-Aug-04 8:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.