none
activate singleton remoting object from server RRS feed

  • Question

  • I've created a service that hosts a singleton object that client services call. I'd like the server to active the object, but I can't seem to get this to work. When I execute the followin code from the server, I can connect the clients to the object.

     RemotingConfiguration.Configure(System.Reflection.Assembly.GetExecutingAssembly().Location & ".config", True)

    If I add the following lines, I get a null exception on the lease.register statement

     RemotingConfiguration.Configure(System.Reflection.Assembly.GetExecutingAssembly().Location & ".config", True)
                            myMonitorConnection = New Connection
                Dim lease As ILease = CType(RemotingServices.GetLifetimeService(myMonitorConnection), ILease)
                sponsor = New IUSponsor
                lease.Register(sponsor)

    When I remove the lease statement, the code will run, but I get a timeout from the clients trying to call the object.

    Any help would be appreciated.

    • Moved by Youen Zen Friday, April 19, 2013 3:15 AM From Visual Basic
    Wednesday, April 17, 2013 7:10 AM

Answers

  • After a bunch of trial and error I found the answer...

    RemotingServices.SetObjectUriForMarshal(myMonitorConnection, "Somewhere.smw")
                RemotingServices.Marshal(myConnection)

    This goes right after the remotingconfiguration.configuration statement.
    Friday, April 19, 2013 5:49 AM

All replies