.NET Remote - Activator.GetObject
-
I read my client configuration from a config file, and it opened my channel sucefully. But, I still have to pass my url string at Activator.GetObject... well, I want to call my activator.getobject without to pass the url or get the url dinamically with channelservices. PS: My object isn't know at client side, so I can't do just a MyObj o = new MyObj(); I need to do something like this MyObj o = (IObj)Activator.GetObject(typeof(IObj),"tcp://localhost:9999/MyObj"); but without this url. I want to use the channel that is already opened by RemotingConfiguration.Configure(file). Thanks so much Wender Oliveira .NET Programmer
-
I read my client configuration from a config file, and it opened my channel sucefully. But, I still have to pass my url string at Activator.GetObject... well, I want to call my activator.getobject without to pass the url or get the url dinamically with channelservices. PS: My object isn't know at client side, so I can't do just a MyObj o = new MyObj(); I need to do something like this MyObj o = (IObj)Activator.GetObject(typeof(IObj),"tcp://localhost:9999/MyObj"); but without this url. I want to use the channel that is already opened by RemotingConfiguration.Configure(file). Thanks so much Wender Oliveira .NET Programmer
Activator.GetObject()
has no knowledege of any type registration at all - type registration exists purely for the benefit of theActivator.CreateInstance()
andnew
activation models. I'm fairly certain that Activator.CreateInstance() requires the type that is being remoted to be available locally as well (new
definitely does). In conclusion, I think you'll have to stick with Activator.GetObject() (and hence passing the URI a lot), unless the type information is available on the client (maybe you could implement a stub class). I'd like to be proved wrong, however! Perhaps there's an advanced use of Activator.CreateInstance() that I've missed. This space for rent! My Blog