views:

54

answers:

1

I am creating a remotable object using WCF. This is a snipped of how I create the remotable object ...

ServiceHost service_host = new ServiceHost(typeof(MyObject), new Uri[] { new Uri("net.pipe://localhost") });
service_host.AddServiceEndpoint(typeof(IMyServer), new NetNamedPipeBinding(), "MyServer");
service_host.Open();
return service_host;

Is there a way to store some variables which are available when the remotable object is instantiated? I would prefer not to control EVERYTHING from the client. Is this possible?

A: 

Maybe I don't understand the question, but your service is hosted in server process, I'd image, such as a Windows service, or a console app. Your remotable object has access to the application configuration setting of the host process. Why don't you put your variables there?

cdonner
That is definitely an option. However, I am running a few of these in a single process and would like to configure them individually.
Nippysaurus