title: Getting MethodAccessException when using LinqBridge
body: <p>I am attempting to use LinqBridge with Compact Framework 2.0 but I get a MethodAccessException when a Linq <code>Where</code> method is called. </p>
  
  <p>First I tried using the pre-compiled assembly from <a href="https://bitbucket.org/raboof/linqbridge" rel="nofollow noreferrer">BitBucket</a>, my own fork with some minor tweeks to compile for CF, and ctacke's fork from his sdf repo on gitHub. </p>
  
  <p>I've been careful about cleaning between builds and cleaning the deployment dir on the device. Also I've been decompiling using DotPeek to confirm that everything in LinqBridge that should be public is showing up as public.  </p>
  
  <h1>Update 1</h1>
  
  <p>Before I was using the following code and it was working fine</p>
  
  <pre><code>public static IEnumerable&lt;TSource&gt; Where&lt;TSource&gt;(this IEnumerable&lt;TSource&gt; source, Func&lt;TSource, bool&gt; predicate)
  {
      foreach (TSource source1 in source)
      {
          if (predicate(source1))
            yield return source1;
      }
  }
  </code></pre>
  
  <h1>Update 2</h1>
  
  <p>The following code throws a MethodAccessException when ran using compact framework 2.0 (using both the precompiled dll from raboof and ctacke's fork), but <strong>not</strong> in Compact Famework 3.5 (using LinqBridge instead of System.Core), or Full Framework 2.0. So I suspect this is a bug in the Compact Framework 2.0 CLR.</p>
  
  <pre><code>using System.Linq;
  static class Program
  {
      private enum Something { a, b, c };
  
      [MTAThread]
      static void Main()
      {
          var dict = new Dictionary&lt;Something, Something&gt;();
          dict.Add(Something.a, Something.a);
          dict.RemoveByValue(Something.a);
      }
  }
  
  public static class DictionaryExtentions
  {
      public static void RemoveByValue&lt;TKey, TValue&gt;(this IDictionary&lt;TKey, TValue&gt; dict, TValue value)
      {
          foreach (var item in dict.Where(kvp =&gt; kvp.Value.Equals(value)).ToArray())
          {
              dict.Remove(item.Key);
          }
      }
  }
  </code></pre>