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?
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?