DotNet Remoting------------->Urgent
-
Hi, I have DotNet remoting question and this is related to while development. I am working on C#/windows application. One of client (window form) need to access the method remotely (from remoting server)...Question: When I am building the client while in development mode do I have to set reference explicitly to the DLL server (remotable object) because if I do that then when moving to production, I don't know in which folder remote server .DLL would be installed. Favourite quote: In youth we learn, In age we understand.
-
Hi, I have DotNet remoting question and this is related to while development. I am working on C#/windows application. One of client (window form) need to access the method remotely (from remoting server)...Question: When I am building the client while in development mode do I have to set reference explicitly to the DLL server (remotable object) because if I do that then when moving to production, I don't know in which folder remote server .DLL would be installed. Favourite quote: In youth we learn, In age we understand.
Maybe you can use UDDI? We use it to find a webservice..
-
Hi, I have DotNet remoting question and this is related to while development. I am working on C#/windows application. One of client (window form) need to access the method remotely (from remoting server)...Question: When I am building the client while in development mode do I have to set reference explicitly to the DLL server (remotable object) because if I do that then when moving to production, I don't know in which folder remote server .DLL would be installed. Favourite quote: In youth we learn, In age we understand.
It's recommended you do not share the actual remotable library. Use interfaces instead, and share only the interface. For example
// server side code only
public class MyRemotableDll : MarshalByRefObject, IMyRemotable
{
void SomeMethod()
{
}
}// server side code, in some other class
MyRemotableDll obj = new MyRemotableDll();
RemotingServices.Marshal(obj, "obj.rem");// shared interface, distribute to both client and server
public interface IMyRemotable
{
void SomeMethod;
}// client side code
IMyRemotable theRemoteObj = (IMyRemotable)RemotingServices.Connect(typeof(IMyRemotable), "http://localhost:4030/obj.rem");
theRemoteObj.SomeMethod();Hope that helps. --------------------------- He who knows that enough is enough will always have enough. -Lao Tsu
-
Hi, I have DotNet remoting question and this is related to while development. I am working on C#/windows application. One of client (window form) need to access the method remotely (from remoting server)...Question: When I am building the client while in development mode do I have to set reference explicitly to the DLL server (remotable object) because if I do that then when moving to production, I don't know in which folder remote server .DLL would be installed. Favourite quote: In youth we learn, In age we understand.
In addition to what Judah said (which is the preferred way when you have control over development like this), you can also use soapsuds.exe from the SDK to generate a client proxy (for cases when you can't dictate how the remote object is developed or deployed).
Microsoft MVP, Visual C# My Articles
-
It's recommended you do not share the actual remotable library. Use interfaces instead, and share only the interface. For example
// server side code only
public class MyRemotableDll : MarshalByRefObject, IMyRemotable
{
void SomeMethod()
{
}
}// server side code, in some other class
MyRemotableDll obj = new MyRemotableDll();
RemotingServices.Marshal(obj, "obj.rem");// shared interface, distribute to both client and server
public interface IMyRemotable
{
void SomeMethod;
}// client side code
IMyRemotable theRemoteObj = (IMyRemotable)RemotingServices.Connect(typeof(IMyRemotable), "http://localhost:4030/obj.rem");
theRemoteObj.SomeMethod();Hope that helps. --------------------------- He who knows that enough is enough will always have enough. -Lao Tsu
Judah, Thanks for the nice solution. I have further question in your solution and it may sound stupid but help me. When I am using interfaces on client side how the call reaches to particular piece on server where this interface is implemented. I mean to say that this interface may have been implemented in different different areas. I know that to reach particular piece we do registration of server and give right address (tcp/http) on client side but my question is interface is just an abstract thing. How the call from client actually reaches to server. Please help.. Favourite quote: In youth we learn, In age we understand.