title: WCF error: extension could not be loaded
body: <p>I defined a class in my project which overrides <code>IDispatchMessageInspector</code> and I added the configuration related but it's doesn't work </p>
  
  <blockquote>
    <p>System.Configuration.ConfigurationErrorsException: The type 'InMotionGIT_NT.Address.Service, CustomHeaders, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' registered for extension 'customHeaders' could not be loaded. (C:\Users\jmachado\Documents\Visual Studio 2010\Projects\InMotionGIT_NT\Address Service\InMotionGIT_NT.Address.Service\bin\Debug\InMotionGIT_NT.Address.Service.dll.config line 67)</p>
  </blockquote>
  
  <p>this is how i called my custom extension</p>
  
  <pre><code>&lt;endpointBehaviors&gt;
      &lt;behavior name="jsonBehavior"&gt;
          &lt;enableWebScript/&gt;
          &lt;customHeaders/&gt;
          &lt;!--&lt;webHttp/&gt;--&gt;
      &lt;/behavior&gt;
  &lt;/endpointBehaviors&gt;    
  </code></pre>
  
  <p>this is how i defined my custom extension</p>
  
  <pre><code>&lt;behaviorExtensions&gt;
      &lt;add name="customHeaders" type="InMotionGIT_NT.Address.Service, CustomHeaders, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/&gt;
  &lt;/behaviorExtensions&gt;
  </code></pre>
  
  <p>Here's the class that I defined, that's inside of my project </p>
  
  <pre><code>[AttributeUsage(AttributeTargets.Class)]
  public class CustomHeaders : IDispatchMessageInspector
  {
      public object AfterReceiveRequest(ref Message request, ClientChannel channel, InstanceContext instanceContext)
      {
          if ((WebOperationContext.Current.IncomingRequest.Method == "GET"))
          {
              WebOperationContext.Current.OutgoingResponse.Headers.Add("Access-Control-Allow-Origin", "*");
              WebOperationContext.Current.OutgoingResponse.Headers.Add("Access-Control-Allow-Methods", "POST");
              WebOperationContext.Current.OutgoingResponse.Headers.Add("Access-Control-Allow-Headers", "Content-Type, Accept");
          }
          return null;
      }
  
      public void BeforeSendReply(ref Message reply, object correlationState)
      {
      }
  }
  </code></pre>
  
  <p>Do I miss something in the configuration?</p>