Add ServiceHost extension by code
===

I have this XML snipped of a `App.config` which I [found here][1]:

    <?xml version="1.0"?>
    <configuration>
      <system.serviceModel>
        <extensions>
          <bindingElementExtensions>
            <add name="gzipMessageEncoding" type="Microsoft.Samples.GZipEncoder.GZipMessageEncodingElement, GZipEncoder, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null" />
          </bindingElementExtensions>
        </extensions>
    ...

For some reasons I don't want to hardcode the asembly and I don't want to use a XML file for that. 

Curriently I use this code:

    Uri baseAddress = new Uri("http://localhost:80/Test");
    WebHttpBinding binding = new WebHttpBinding(
                                        WebHttpSecurityMode.TransportCredentialOnly);
    binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
    ServiceHost host = new ServiceHost(typeof(ExampleWebService), baseAddress);
    host.Extensions.Add(new GZipMessageEncodingElement());

But the last line does not work how can I fix that? I think it must be possible to do that by code.

  [1]: http://msdn.microsoft.com/en-us/library/ms751458.aspx