title: Lots of first chance Microsoft.CSharp.RuntimeBinderExceptions thrown when dealing with dynamics
body: <p>I've got a standard 'dynamic dictionary' type class in C# - </p>
  
  <pre><code>class Bucket : DynamicObject
  {
      readonly Dictionary&lt;string, object&gt; m_dict = new Dictionary&lt;string, object&gt;();
  
      public override bool TrySetMember(SetMemberBinder binder, object value)
      {
          m_dict[binder.Name] = value;
          return true;
      }
  
      public override bool TryGetMember(GetMemberBinder binder, out object result)
      {
          return m_dict.TryGetValue(binder.Name, out result);
      }
  }
  </code></pre>
  
  <p>Now I call it, as follows:</p>
  
  <pre><code>static void Main(string[] args)
  {
      dynamic d = new Bucket();
      d.Name = "Orion"; // 2 RuntimeBinderExceptions
      Console.WriteLine(d.Name); // 2 RuntimeBinderExceptions
  }
  </code></pre>
  
  <p>The app does what you'd expect it to, but the debug output looks like this:</p>
  
  <pre>
  A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
  A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
  'ScratchConsoleApplication.vshost.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted DynamicMethods Assembly'
  A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
  A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
  </pre>
  
  <p><em>Any</em> attempt to access a dynamic member seems to output a <code>RuntimeBinderException</code> to the debug logs. While I'm aware that first-chance exceptions are not a problem in and of themselves, this does cause some problems for me:</p>
  
  <ol>
  <li><p>I often have the debugger set to "break on exceptions", as I'm writing WPF apps, and otherwise all exceptions end up getting converted to a <code>DispatcherUnhandledException</code>, and all the actual information you want is lost. WPF sucks like that.</p></li>
  <li><p>As soon as I hit any code that's using <code>dynamic</code>, the debug output log becomes fairly useless. All the useful trace lines that I care about get hidden amongst all the useless <code>RuntimeBinderException</code>s</p></li>
  </ol>
  
  <p>Is there any way I can turn this off, or is the <code>RuntimeBinder</code> unfortunately just built like that?</p>
  
  <p>Thanks, Orion</p>