title: Iterate over IDictionary with implicit DictionaryEntry
body: <p>Consider this code:</p>
  
  <pre><code>var variables = System.Environment.GetEnvironmentVariables();
  foreach (DictionaryEntry vari in variables)
  {
      Console.WriteLine(vari.Key);
      Console.WriteLine(vari.Value);
  }
  </code></pre>
  
  <p>It works fine. Since <code>variables</code> is <code>IDictionary</code>, it consists of <code>DictionaryEntry</code>, with <code>object Key</code> and <code>object Value</code>.</p>
  
  <p>Why cannot I type <code>foreach(var vari in variables)</code>? It gives me</p>
  
  <pre><code>error CS1061: 'object' does not contain a definition for 'Key/Value'...
  </code></pre>
  
  <p>It seems strange and I cannot find a reason for this behaviour. <code>DictionaryEntry</code> is a <code>struct</code>, but I can iterate over a <code>List&lt;DictionaryEntry&gt;</code> all right. Of course I understand that <code>IDictionary</code> is not generic, but the <a href="http://msdn.microsoft.com/pl-pl/library/system.collections.idictionary.aspx" rel="noreferrer">manual</a> says it contains <code>DictionaryEntries</code>, so it should be possible to use <code>var</code>...</p>