kalliopi
asked on
.NET Remoting (GetObejct vs. RemotingConfiguration.Configure)
I have a strange situation. I have a client app, where this line works correctly:
My App config includes this:
MyRemoteObj liason = (MyRemoteObj)Activator.GetObject(typeof(MyRemoteObj),
"tcp://localhost:2396/MyRemoteObj");
But after doing this: RemotingConfiguration.RegisterWellKnownServiceType(typeof(MyRemoteObj),
"tcp:`//localhost:2396/MyRemoteObj", WellKnownObjectMode.Singleton);
or this: String path = String.Format("{0}.config", Application.ExecutablePath);
RemotingConfiguration.Configure(path, false);
I am UNABLE to use MyRemoteObject liason = new MyRemoteObject();
It simply instantiates a new local object. What am I missing?My App config includes this:
<system.runtime.remoting>
<application>
<client>
<wdellknown type="Testing.MyRemoteObject, Testing" url="tcp://localhost:2396/MyRemoteObj"/>
</client>
</application>
</system.runtime.remoting>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
CodeCruiser - thanks for the suggestion. In answer to your question, no, I'm not explicitly registering a channel. That being said, what I don't get is that I'm doing remoting in another app, and don't need (on the client side) anything more than I have in this original post. I put the "WellKnown" keyword in the app.config. Call RemotingConfiguration.Conf igure(...) and then when I new up that type, it does so using remoting - just as expected. For some reason, I can't get it working in this app and I'm trying to figure out why.
Any suggestions appreciated.
Any suggestions appreciated.
ASKER
Sorry - I just answered both questions myself. I needed to be using this:
RemotingConfiguration.Regi sterWellKn ownClientType
Rather than RegisterWellKnownServiceTy pe. Also, it appears I just had a typo in my client app.config, since <wdellknown> is not the appropriate keyword. Changing the RegisterWellKnownType fixed the problem with that method. Fixing the tag fixed the problem using the RemotingConfiguration.Conf igure.
Thanks for the help guys!
RemotingConfiguration.Regi
Rather than RegisterWellKnownServiceTy
Thanks for the help guys!
ASKER
The issue I'm trying to resolve is the SPECIFIC situation of .GetObject working (which tells me that the server side is configured correctly) but the NEW keyword NOT working. On another remoting app which works, once I call the .Configure(...) method - any well known types registered there are created as CAO objects. For some reason, that's not happening in this app - and I don't get why.
Specifically - what might prevent my app from registering/handling well known types correctly?