title: C# .Net 4.0 mscorlib contains ReadOnlyDictionary?
body: <p>I need a <code>ReadOnlyDictionary</code>. All posts told me that there is none in .Net 4.0. For that reason I created my own implementation.</p>
  
  <p>After doing that Resharper 5.1 told me about an ambiguous reference to <code>System.Collections.ObjectsModel.ReadOnlyDictionary</code> but the code is compiling without errors.</p>
  
  <p>I tried to use this implementation but it's not accessible. Why?</p>
  
  <p>I wrote the following Code to test whether there is a <code>ReadOnlyDictionary</code> in .Net 4.0:</p>
  
  <pre><code>var foo = from assembly in AppDomain.CurrentDomain.GetAssemblies()
            where assembly.FullName.Contains("mscorlib")
            from type in assembly.GetTypes()
            where type.Name.StartsWith("ReadOnly")
            select type.FullName + " " + assembly.FullName;
  </code></pre>
  
  <p>And the surprising result is:</p>
  
  <pre><code>System.Collections.ReadOnlyCollectionBase mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Collections.ObjectModel.ReadOnlyCollection`1 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Collections.ObjectModel.ReadOnlyDictionary`2 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Collections.ObjectModel.ReadOnlyDictionaryHelpers mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Runtime.InteropServices.WindowsRuntime.ReadOnlyArrayAttribute mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Runtime.InteropServices.WindowsRuntime.ReadOnlyDictionaryKeyCollection`2 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Runtime.InteropServices.WindowsRuntime.ReadOnlyDictionaryKeyEnumerator`2 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Runtime.InteropServices.WindowsRuntime.ReadOnlyDictionaryValueCollection`2 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Runtime.InteropServices.WindowsRuntime.ReadOnlyDictionaryValueEnumerator`2 mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Security.ReadOnlyPermissionSet mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Security.ReadOnlyPermissionSetEnumerator mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Collections.ArrayList+ReadOnlyList mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  System.Collections.ArrayList+ReadOnlyArrayList mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  </code></pre>
  
  <p>There is a <code>ReadOnlyDictionary</code> in .Net 4.0. I used dotPeek 1.1 to reflect for this type and it’s public. </p>
  
  <p>Why is this type inaccessible? 
  What can I do to prevent the ambiguous reference in Resharper 5.1 (7.1 doesn’t have this problem)?</p>