remoting serialization exception

S

Steve

I've been following a couple remoting tutorials on the web, they are all
pretty much the same.
I've got my different applications built(client, server and remote object
(dll))

The client is able to get a reference to the remote object and that works
fine. When I try to make a call to a remote object's method I get an
exception:
System.Runtime.Serialization.SerializationException: Cannot find the
assembly ProcessTest, Version=1.0.2021.22452, Culture=neutral,
PublicKeyToken=null.

"ProcessTest" is the client application. Now, pasting all my code would be
a little bit much, so I'm hoping that from this error someone will be able
to give me a clue, if not, I can post what I think is the relevant code.

Thanks,
Steve
 
G

Guest

Just to make sure, you are dealing with 3 separate assemblies? The client,
the server and the remote object? Is the same remote object being referenced
by both projects?

I’ve seen it far too many times in past with my remoting work to have the
client and server using slightly different versions of the remote object
assembly, only to give up and throw a hissy fit because of it.

Brendan
 
S

Steve

Brendan Grant said:
Just to make sure, you are dealing with 3 separate assemblies? The client,
the server and the remote object? Is the same remote object being referenced
by both projects?

I've seen it far too many times in past with my remoting work to have the
client and server using slightly different versions of the remote object
assembly, only to give up and throw a hissy fit because of it.

Brendan
Hi Brendan,

Yes, that is a good point and one that could be easily overlooked. I just
rebuilt everything in the following order;
remoteobject
server
client

so the client and server are using the same dll for sure.

I tried running the client again, here is the stack trace that is dumped (it
looks like the exception is happening on the server application?):
Server stack trace:
at
System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembl
y()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAs
semblyInfo 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.ReadObjectWith
MapTyped(BinaryObjectWithMapTyped record)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWith
MapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Head
erHandler handler, __BinaryParser serParser, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(S
tream serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage
(String objectUri, Stream inputStream, Boolean bStrictBinding,
TypeFilterLevel securityLevel)
at
System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IS
erverChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders
requestHeaders, Stream requestStream, IMessage& responseMsg,
ITransportHeaders& responseHeaders, Stream& responseStream)
 
G

Guest

Another area I ran into this bug was with events, I would attempt to
subscribe to an event on the reference and things would go to hell... but
given that you are having this issue when you call a method, it may not be
the same.

Are you using a CAO model for your remoting object(s)?

Take a look at http://www.thecodeproject.com/csharp/caofactoryguide.asp for
some info on how CAO works and how to implement it.

Brendan


Steve said:
Brendan Grant said:
Just to make sure, you are dealing with 3 separate assemblies? The client,
the server and the remote object? Is the same remote object being referenced
by both projects?

I've seen it far too many times in past with my remoting work to have the
client and server using slightly different versions of the remote object
assembly, only to give up and throw a hissy fit because of it.

Brendan
Hi Brendan,

Yes, that is a good point and one that could be easily overlooked. I just
rebuilt everything in the following order;
remoteobject
server
client

so the client and server are using the same dll for sure.

I tried running the client again, here is the stack trace that is dumped (it
looks like the exception is happening on the server application?):
Server stack trace:
at
System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembl
y()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAs
semblyInfo 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.ReadObjectWith
MapTyped(BinaryObjectWithMapTyped record)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWith
MapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Head
erHandler handler, __BinaryParser serParser, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(S
tream serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage
(String objectUri, Stream inputStream, Boolean bStrictBinding,
TypeFilterLevel securityLevel)
at
System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IS
erverChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders
requestHeaders, Stream requestStream, IMessage& responseMsg,
ITransportHeaders& responseHeaders, Stream& responseStream)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top