title: Intercepting a WCF Service with Autofac
body: <p>I am attempting to intercept methods on a WCF service server side with the following registration:</p>
  
  <pre><code>containerBuilder.RegisterType&lt;Service&gt;().As&lt;IServiceContract&gt;().InstancePerLifetimeScope()
                  .EnableInterfaceInterceptors().InterceptedBy(typeof(MethodInterceptor));
  </code></pre>
  
  <p>however, when I do the service endpoint disappears.  The WCF service is hosted inside a Windows Service.  Any ideas?</p>
  
  <p>The exception I receive is as follows:</p>
  
  <blockquote>
    <p>System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at<code>http://localhost:8000/endpointaddress</code>that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. --->
    System.Net.WebException: The remote server returned an error: (404) Not Found.</p>
  </blockquote>
  
  <p>The MethodInterceptor is registered as follows:</p>
  
  <pre><code>containerBuilder.Register(componentContext =&gt; new MethodInterceptor(invocation =&gt;
  {
      return new NLogToLoggerAdaptor(LogManager.GetLogger(invocation.InvocationTarget.GetType().FullName));
  })).InstancePerLifetimeScope();
  </code></pre>