title: Does relay supported in the On-Premises Service Bus 1.1 SDK (Not Azure Cloud)
body: <p>Does relay supported in the On-Premises Service Bus 1.1 SDK (Not Azure Cloud)</p>
  
  <p>Below code works fine when hosted in Azure Cloud Service Bus but does not work in the On-Premises Service Bus 1.1.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect;
  string serviceNamespace = "ServiceBusDefaultNamespace";
  string issuerName = "owner";
  string issuerSecret = "[Secret Key Here]";
  ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect;
  var address = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace,    "EchoService");
  var binding = new NetTcpRelayBinding();
  var behavior = new TransportClientEndpointBehavior(); 
  
  binding.Security.Mode = EndToEndSecurityMode.Transport;
  binding.Security.RelayClientAuthenticationType =     RelayClientAuthenticationType.RelayAccessToken;
  
  behavior.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuerName,   issuerSecret);
  ServiceHost host = new ServiceHost(typeof(EchoService));
  var endpoint = host.AddServiceEndpoint(typeof(IEchoContract), binding, address);
  endpoint.Behaviors.Add(behavior);
  host.Open();
  </code></pre>
  
  <p><strong>Error while instantiating the ServiceHost</strong></p>