Groups | Blog | Home
all groups > dotnet component services > september 2005 >

dotnet component services : Confusing Remoting Error


Rob Perkins
9/7/2005 4:28:34 PM
I'm getting the following error

An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in
mscorlib.dll

Additional information: Cannot find the assembly SCQueueClientTest,
Version=1.0.2074.15411, Culture=neutral, PublicKeyToken=null.


....when I attempt to add an event handler delegate to a remoted object
called as follows:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
o =
Activator.GetObject(GetType(SCMessagingSingleton.SCMessageStore),
"tcp://localhost:64738/SCMessaging.rem")
AddHandler o.TestEvent, AddressOf o_TestEvent
o.TestFunction()
RemoveHandler o.TestEvent, AddressOf o_TestEvent
End Sub

Private Sub o_TestEvent(ByVal sender As Object, ByVal e As
SCMessagingSingleton.SCMessageStoreEventArgs)
MessageBox.Show(e.Message)
End Sub

Without the AddHandler call, o.TestFunction() works perfectly.

Can anyone shed some light on this, bearing in mind that
"SCQueueClientTest" is the name of both the solution and the project for
this client, but is not explicitly declared in the project?

Setup code for the server is:
Dim sp As New BinaryServerFormatterSinkProvider
Dim cp As New BinaryClientFormatterSinkProvider
Dim Properties As IDictionary = New Hashtable
Dim channel As TcpChannel
sp.TypeFilterLevel =
Runtime.Serialization.Formatters.TypeFilterLevel.Full
Properties("port") = 64738

channel = New TcpChannel(Properties, cp, sp)
ChannelServices.RegisterChannel(channel)

RemotingConfiguration.RegisterWellKnownServiceType( _
GetType(SCMessagingSingleton.SCMessageStore), _
"SCMessaging.rem", _
WellKnownObjectMode.Singleton)

And for the client:

Dim ServerProvider As New BinaryServerFormatterSinkProvider
Dim ClientProvider As New BinaryClientFormatterSinkProvider
Dim Properties As IDictionary = New Hashtable
Dim Channel As TcpChannel
Dim RemoteType As WellKnownClientTypeEntry

ServerProvider.TypeFilterLevel =
Runtime.Serialization.Formatters.TypeFilterLevel.Full
Properties("port") = 0
Channel = New TcpChannel(Properties, ClientProvider,
ServerProvider)
ChannelServices.RegisterChannel(Channel)
RemoteType = New
WellKnownClientTypeEntry(GetType(SCMessagingSingleton.SCMessageStore), _
"tcp://localhost:64738/SCMessaging.rem")
Robert Jordan
9/16/2005 8:00:22 PM
Hi Rob,

[quoted text, click to view]

See this article:

http://www.codeproject.com/csharp/RemotingAndEvents.asp

AddThis Social Bookmark Button