Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with deserializing..

Status
Not open for further replies.

matthewking

Programmer
Jul 15, 2002
75
0
0
ES
Hi,

I have two applications, one is a server and one is a client.

upon recieving data the server sends a serialized "Request" (I know this is teh wrong way around but im only prototying anyway) object to the client, but when I try to deserialize the object on the client side I get this exception:

System.Runtime.Serialization.SerializationException: Cannot find the assembly AgencyManagerServer, Version=1.0.1353.22661, Culture=neutral, PublicKeyToken=null.
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create(String name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at Client_Application_Test.Form1.Deserialize(Byte[] data) in c:\documents and settings\matt\my documents\visual studio projects\client application test\form1.cs:line 214

on line 214 I have this:

return formatter.Deserialize(stream);

thats within a function that returns a object after deserializing the byte data.

The server contains classes IRequest and Request. and the client contains IRequest.

I have no idea why the client is trying to reference the server application? theres no class members for Request..

Any help? Thanks in advance,

matt.
 
It could be as simple as the server version being different from the version of the server the client was built against. If the version number doesn't match, when the object is passed back to the client, it can't deserialize it.

Check the client manifest. Look at the version number for the server assembly. Then check the version number in the actual server assembly. If they don't match, you have found the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top