title: Wcf Facility using net.tcp
body: <p>I'm trying to configure my WCF services to use net.tcp or netnamedpipes. </p>
  
  <p>here is my container config (I've commented out the existing http binding):</p>
  
  <pre><code>        var metadata = new ServiceMetadataBehavior
          {
              HttpGetEnabled = true
          };
  
          var debug = new ServiceDebugBehavior
          {
              IncludeExceptionDetailInFaults = true
          };
  
          container.AddFacility&lt;WcfFacility&gt;(f =&gt; f.Services.AspNetCompatibility =
                                             AspNetCompatibilityRequirementsMode.Required)
              .Install(Configuration.FromAppConfig())
              .Register(
                  Component.For&lt;IServiceBehavior&gt;().Instance(metadata),
                  Component.For&lt;IServiceBehavior&gt;().Instance(debug),
                  Component
                      .For&lt;IAccountService&gt;()
                      .ImplementedBy&lt;AccountService&gt;()
                      .Named("SomeCompany.Services.Account.AccountService")
                      .LifeStyle.Transient
                      .ActAs(new DefaultServiceModel().Hosted().AddEndpoints(
                                     //WcfEndpoint.BoundTo(new BasicHttpBinding { MaxReceivedMessageSize = int.MaxValue }),
                                     //WcfEndpoint.BoundTo(new WSHttpBinding(SecurityMode.None) { MaxReceivedMessageSize = int.MaxValue }).At("ws"),
                                     WcfEndpoint.BoundTo(new NetTcpBinding()).At("net.tcp://localhost/Account") 
                                 )),
                  Component
                      .For&lt;IAccountNetworkService&gt;()
                      .ImplementedBy&lt;AccountNetworkService&gt;()
                      .Named("SomeCompany.Services.Account.AccountNetworkService")
                      .LifeStyle.Transient
                      .ActAs(new DefaultServiceModel().Hosted()
                                 .AddEndpoints(
                                     WcfEndpoint.BoundTo(new BasicHttpBinding { MaxReceivedMessageSize = int.MaxValue }),
                                     WcfEndpoint.BoundTo(new WSHttpBinding(SecurityMode.None) { MaxReceivedMessageSize = int.MaxValue }).At("ws")
                                 ))
             );
  </code></pre>
  
  <p>My client has the following:</p>
  
  <pre><code>&lt;endpoint address="net.tcp://localhost/Account" binding="netTcpBinding" contract="SomeCompany.Services.Account.Contracts.IAccountService" name="accountServiceClient"&gt;&lt;/endpoint&gt;
  </code></pre>
  
  <p>When I try to access the service I get the following:</p>
  
  <pre><code>No connection could be made because the target machine actively refused it 127.0.0.1:808
  </code></pre>
  
  <p>I have also tried the suggestion placed at the bottom of this wiki:</p>
  
  <p><a href="http://docs.castleproject.org/(S(hv034j45ln0cgt2zkpl1nce5))/Windsor.WCF-Facility-Registration.ashx" rel="nofollow">http://docs.castleproject.org/(S(hv034j45ln0cgt2zkpl1nce5))/Windsor.WCF-Facility-Registration.ashx</a></p>
  
  <p>Am I missing something blatant here?</p>