title: Debugging error "The Type 'xx' is defined in an assembly that is not referenced"
body: <p>The full error is as follows:</p>
  <blockquote>
  <p>The type
  'System.Windows.Forms.Control' is
  defined in an assembly that is not
  referenced. You must add a reference
  to assembly 'System.Windows.Forms,
  Version=2.0.0.0, Culture=neutral,
  PublicKeyToken=b77a5c561934e089'.</p>
  </blockquote>
  <p>and it points at the very first statement (an Debug.Assert line) in the very first class in a library project that doesn't need <code>System.Windows.Forms</code> (or so I thought). I know how to solve it: add the mentioned reference. But how do I find out what library is causing this error, or better, what part of the code triggers using the WinForms library?</p>
  <p>Normally, you can add libraries that reference others, but you only need to add references to these others when they're actually used.</p>
  <hr />
  <h3>EDIT: Alternative solution</h3>
  <p><em>This or similar problems can also be resolved using the <a href="http://msdn.microsoft.com/en-us/library/e74a18c4.aspx" rel="noreferrer">Binding Log Viewer Fuslogvw.exe</a> from Microsoft's Framework Tools. It shows all attempts and successes of assemblies your application binds to.</em></p>