WCF service is hosted in IIS and uses netTCPRelayBinding
.
At some locations the TCP ports are blocked and HTTP must be used. Other times TCP ports are open and this mode is preferred.
Thus, I'd like to be able to set the ConnectivityMode
to AutoDetect
(or to just HTTP) declaratively in the web.config
file.
For self hosted WCF, this is easily done:
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect;
How is this done declaratively in web.config
?
At the moment there is no configuration element for this setting however in your web.config you could use AppSettings to set the value
In the code you would then read the key value and parse it into enum value