title: CLR Can't find a type, even though it's in the same assembly
body: <p>I'm troubleshooting a WCF problem in our application, and turned on WCF tracing with the WCF Service Configuration Editor in VS 2010, which added the following sharedListener to the web.config:</p>
  
  <pre><code>    &lt;sharedListeners&gt;
        &lt;add initializeData="D:\Logs\CRCCustomerService\Web_tracelog.svclog"
          type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
          name="ServiceModelTraceListener" traceOutputOptions="Timestamp"&gt;
          &lt;filter type="" /&gt;
        &lt;/add&gt;
      &lt;/sharedListeners&gt;
  </code></pre>
  
  <p>Now, when I take steps to reproduce my error, I'm getting an exception thrown from the System.Diagostics library saying that it can't find XmlWriterTraceListener:</p>
  
  <pre><code>Stack Trace: 
  System.TypeInitializationException: The type initializer for       'System.ServiceModel.DiagnosticUtility' threw an exception. ---&gt;   System.Configuration.ConfigurationErrorsException: Couldn't find type for class System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. 
  at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType,    String initializeData) 
  at System.Diagnostics.TypedElement.BaseGetRuntimeObject() 
  at System.Diagnostics.ListenerElement.GetRuntimeObject() 
  at System.Diagnostics.ListenerElement.GetRuntimeObject() 
  at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() 
  at System.Diagnostics.TraceSource.Initialize() 
  at System.Diagnostics.TraceSource.get_Listeners() 
  </code></pre>
  
  <p>And it goes on for several more lines, but this establishes the context.</p>
  
  <p>My question is, since, according to ObjectBrowser and Reflector, XmlWriterTraceListener is a member class of the same assembly that System.Diagnostics is, how can it NOT not be able to find it?</p>
  
  <p>And secondly, since every single line in the exception stack comes from system code, how on earth do I begin to debug the root cause here?</p>