Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. .NET Remote - Activator.GetObject

.NET Remote - Activator.GetObject

Scheduled Pinned Locked Moved C#
csharpworkspace
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wender Oliveira
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • W Wender Oliveira

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Activator.GetObject() has no knowledege of any type registration at all - type registration exists purely for the benefit of the Activator.CreateInstance() and new 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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups