title: Casting a generic dictionary containing a generic dictionary
body: <p>I have:</p>
  
  <pre><code>var someConcreteInstance = new Dictionary&lt;string, Dictionary&lt;string, bool&gt;&gt;();
  </code></pre>
  
  <p>and I wish to cast it to an interface version, i.e.:</p>
  
  <pre><code>someInterfaceInstance = (IDictionary&lt;string, IDictionary&lt;string, bool&gt;&gt;)someConcreteInstance;
  </code></pre>
  
  <p>'someInterfaceInstance' is a public property:</p>
  
  <pre><code>IDictionary&lt;string, IDictionary&lt;string, bool&gt;&gt; someInterfaceInstance { get; set; }
  </code></pre>
  
  <p>This compiles correctly, but throws a runtime casting error.</p>
  
  <pre><code>Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.String,System.Boolean]]' to type 'System.Collections.Generic.IDictionary`2[System.String,System.Collections.Generic.IDictionary`2[System.String,System.Boolean]]'.
  </code></pre>
  
  <p>What am I missing? (Problems with the nested generic type/Property?)</p>