I'm attempting to build a Windows service from which I can manage it through a GUI on another computer using Remoting.
I have an Interface that is referenced both by the service, and the managing program.
In the service the interface is implemented in a class that inherits the MarshalByRefObject
The service starts listening via the following:
In the client I am doing this to connect:
The ServiceStateChanged event is defined in the interface - and the AddHandler line is also where I am having difficulty.
At that line I am getting the error like "Could not load file or assembly {0} or one of its dependencies. The system cannot find the file specified."
Most likely because the server service doesn't have access to the managing gui requesting the addhandler.
Any ideas on how I can get the client to subscribe to the events?
Thanks.
I have an Interface that is referenced both by the service, and the managing program.
In the service the interface is implemented in a class that inherits the MarshalByRefObject
Code:
Public Class clsSharedObject
Inherits MarshalByRefObject
Implements iMySharedObject
The service starts listening via the following:
Code:
Dim formatter As New BinaryServerFormatterSinkProvider
formatter.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full
channel = New TcpServerChannel("RemChannelName", port, formatter)
ChannelServices.RegisterChannel(channel, False)
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off
RemotingServices.Marshal(mgr, "MySharedObject")
In the client I am doing this to connect:
Code:
Dim formatter As New BinaryClientFormatterSinkProvider()
Dim channel As New TcpClientChannel("RemChannelName", formatter)
ChannelServices.RegisterChannel(channel, False)
manager = CType(Activator.GetObject(GetType(iMySharedObject), "tcp://192.168.102.3:9000/MySharedObject"), iMySharedObject)
AddHandler manager.ServiceStateChanged, AddressOf manager_ServiceStateChanged
At that line I am getting the error like "Could not load file or assembly {0} or one of its dependencies. The system cannot find the file specified."
Most likely because the server service doesn't have access to the managing gui requesting the addhandler.
Any ideas on how I can get the client to subscribe to the events?
Thanks.