I have a working distributed application that has a rather big blemish. The client.exe needs the server.exe to work.
The reason for this is that the client and server use a MarshalByRef Class (which exists on both sides in the form of a .DLL)开发者_如何学JAVA which contains a reference to the server.
Is there any way I can rearrange things so that I don't need a copy of the server.exe on the client?
Yes.
Create a seperate assembly (dll), which contains the shared classes / interfaces, and distribute that dll with your client and server. By doing so, the client doesn't need the server.exe, it just needs the shared dll.
Create an interface that represents the methods, properties, etc, of this MarshalByRef class, have the class implement this interface, place the interface in a separate DLL, and just use that from the client.
There are plenty of examples around if you google for remoting interface.
精彩评论