WCF Service fails to start when adding trace logging config
===

I have a working WCF service that I wanted to hook into so I can look at the logs. So, I added a .config file, and now my service will not start at all.

In my code I do the following:

    private ServiceHost _myHost;
....

            _myHost= new ServiceHost(typeof (MyType), new Uri(baseUri));
            _myHost.AddServiceEndpoint(typeof (myInterface), new NetNamedPipeBinding(), hostName);
            _myHost.Open();

And, as mentioned, this works when I do not have a .config file. However, to view the logs I have to add a .config file that looks like this:

       <system.diagnostics>
      <sources>
         <source propagateActivity="true" name="System.ServiceModel" switchValue="Verbose,ActivityTracing">
            <listeners>
               <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                  <filter type="" />
               </add>
               <add initializeData="c:\logs\Traces.svclog" type="System.Diagnostics.XmlWriterTraceListener"
                  name="traceListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
                  <filter type="" />
               </add>
            </listeners>
         </source>
      </sources>
   </system.diagnostics>
   <system.serviceModel>
      <diagnostics>
         <messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true"
            logMessagesAtTransportLevel="true" />
         <endToEndTracing activityTracing="true" messageFlowTracing="true" />
      </diagnostics>
   </system.serviceModel>

The error I now get in the logger is `Failed to open System.ServiceModel.ServiceHost` and it occurs at the instance creation of my `ServiceHost`. So, why does adding a logging config make any difference?

