title: ServiceHostFactory with multiple bindings
body: <p>How do I use a ServiceHostFactory with multiple bindings?</p>
  
  <p>This is what I've tried and I keep getting issues, one after another error.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.ServiceModel;
  using System.ServiceModel.Activation;
  using System.ServiceModel.Web;
  using System.Web.Services.Description;
  using System.ServiceModel.Description;
  using System.ServiceModel.Channels;
  
  namespace WcfService7
  {
      public class clsMyOwnServiceHost : ServiceHostFactory
      {    
          protected override ServiceHost CreateServiceHost(Type t, Uri[] baseAddresses)
          {
              NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);
              BasicHttpBinding basicbinding = new BasicHttpBinding(BasicHttpSecurityMode.None);
              WSHttpBinding wsbinding = new WSHttpBinding(SecurityMode.None);
              ServiceHost host = new ServiceHost(t, baseAddresses);
  
              foreach(Uri uri in baseAddresses)
              {
                  host.AddServiceEndpoint(typeof(IService1), basicbinding, uri);
                  host.AddServiceEndpoint(typeof(IService1), wsbinding, uri);       
                  host.AddServiceEndpoint(typeof(IService1), binding, uri);          
              }
  
              return host;
          }
      }
  }
  </code></pre>