Remoting - Watching remote objects...
-
Hello experts, I use remoting in my application, but I can't tell if the remote object was really retrieved. When I use the
Activator.GetObject()
method it does not throw any exception, and if I set a watch for my retrieved object all I see are details regarding the proxy (i.e. the watch shows the details of aSystem.Runtime.Remoting.Proxies.__TransparentProxy
object). And when I try to call a property inside of the remote object, I get aNullReferenceException
. I know this might not be enough information to solve theNullReferenceException
problem, but how can I make sure that I realy have a reference to my remote object, and how should one go about debugging remote objects? Thanks in advance, Shy. -
Hello experts, I use remoting in my application, but I can't tell if the remote object was really retrieved. When I use the
Activator.GetObject()
method it does not throw any exception, and if I set a watch for my retrieved object all I see are details regarding the proxy (i.e. the watch shows the details of aSystem.Runtime.Remoting.Proxies.__TransparentProxy
object). And when I try to call a property inside of the remote object, I get aNullReferenceException
. I know this might not be enough information to solve theNullReferenceException
problem, but how can I make sure that I realy have a reference to my remote object, and how should one go about debugging remote objects? Thanks in advance, Shy. -
Hello experts, I use remoting in my application, but I can't tell if the remote object was really retrieved. When I use the
Activator.GetObject()
method it does not throw any exception, and if I set a watch for my retrieved object all I see are details regarding the proxy (i.e. the watch shows the details of aSystem.Runtime.Remoting.Proxies.__TransparentProxy
object). And when I try to call a property inside of the remote object, I get aNullReferenceException
. I know this might not be enough information to solve theNullReferenceException
problem, but how can I make sure that I realy have a reference to my remote object, and how should one go about debugging remote objects? Thanks in advance, Shy.Hi! The proxy is created when you call
Activator.GetObject()
but until you actually call any method on the remote object, there's no need to establish a network connection to the server. From my understanding, the remoting infrastructure doesn't hold the network connection open all the time and chokes whenever the remoting server goes down, but is only interested in whether the server can be reached during method calls to the remote object. So the only way to find out whether the server is running is to actually call a method on the remote object. For one of my projects I added a simpleAvailable
property (always returningtrue
) to the server object so that I have a method to call without any sideeffects.Regards, mav -- Black holes are the places where God divided by 0...