WCF host instant and open programmatically - how to relate to binding in app.config?
-
hello For WCF host instantiated and opened programmatically - how to relate to binding in app.config? For example, here we get the channel open: using (ServiceHost host = new ServiceHost(typeof(GridControllerService))) { System.ServiceModel.WSDualHttpBinding binding = new WSDualHttpBinding(); binding.OpenTimeout = new TimeSpan(3, 0, 0); binding.CloseTimeout = new TimeSpan(3, 0, 0); binding.SendTimeout = new TimeSpan(3, 0, 0); binding.ReceiveTimeout = new TimeSpan(3, 0, 0); binding.MaxBufferPoolSize = 5000; host.AddServiceEndpoint(typeof(IGridControllerService), binding, "wsDualHttpBinding"); host.Open(); But instead of programmatically code up the binding config, we code have relate it to what's already in app.config <system.serviceModel> <bindings> <wsDualHttpBinding> <binding name="SomeHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" .... In this case, how can I relate "host" instantiated programmatically (yes weird why not do the whole deal in config right? But that's not my question) to "SomeHttpBinding" in config file. Thanks