Re: Error while invoking remoteobject method

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



source wrote:
I was not able to resolve to the domain InProc when I did nsLookup InProc

I was wondering if it cannot find the Host, how come I do not get an error on this line
InProcessHost inProcIPH = (InProcessHost)Activator.GetObject(typeof(InProcessHost), "tcp://InProc:8086");

But I even tried this as I am running both server and clinet on the same machine
InProcessHost inProcIPH = (InProcessHost)Activator.GetObject(typeof(InProcessHost), "tcp://<myIPaddress>:8086");

If I do this with the IP Address, the object gets created, but then
if I try to invoke any method like
inProcIPH.Foo();
"Value cannot be null.
Parameter name: URI"
....

Connection is actually established at first method call, nat at the point you call Activator.GetObject ("lazy connect"). That's why it trows exception when you call inProcIPH.Foo(). Try following:

InProcessHost inProcIPH =
(InProcessHost)Activator.GetObject(typeof(InProcessHost),
"tcp://127.0.0.1:8086/InProc"); You are missing /InProc in your URI.

Regards,
Goran
.