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")
RemotingConfiguration.RegisterWellKnownClientType(RemoteType)
Robert Jordan - 16 Sep 2005 19:00 GMT
Hi Rob,
> I'm getting the following error
>
[quoted text clipped - 4 lines]
> Additional information: Cannot find the assembly SCQueueClientTest,
> Version=1.0.2074.15411, Culture=neutral, PublicKeyToken=null.
See this article:
http://www.codeproject.com/csharp/RemotingAndEvents.asp
Rob