title: Remove/add MessageHandlers at runtime
body: <p>How can I add or remove message handlers at runtime?
  The following example does not work:</p>
  
  <pre><code>var logHandler = GlobalConfiguration.Configuration.MessageHandlers.FirstOrDefault(a =&gt; a.GetType() == typeof(ApiLogHandler));
  
  if (logHandler == null)
  {
      GlobalConfiguration.Configuration.MessageHandlers.Add(new ApiLogHandler());
  }
  else
  {
      GlobalConfiguration.Configuration.MessageHandlers.Remove(logHandler);
  }
  </code></pre>
  
  <p>The message handler <strong>is added</strong> to the list,
  but it is not called in the the next requests...</p>