Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access to Singleton via .NET Remoting

Status
Not open for further replies.

mcowen

Programmer
Oct 21, 2001
134
0
0
GB
Hi
I've been trying to create an object within a Windows Service and then publish the object in the constructor of the remote object i.e within itself. I can't seem to get this to work though I can only ever publish the object within the Service object using Remoting.Configure. My Windows Service ends up setting up the remote object and then making a call as if it were a client in order to activate the remote object. This does not seem a very elegant approach.

Does anyone know if it is possible to publish an object within its constructor? I should then be able to more easily serialize and deserialize the object.

Does anyone know if it is possible to create an object and activate it on the server without the server having to act like a client?

Matt
 
A singleton object is unique within the AppDomain.

When making remoting calls, a new AppDomain is created for the call, thus you get a new singleton every time.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top