title: Petapoco: Operation could destabilize the runtime
body: <p>I am trying to use Petapoco's multi-poco query.</p>
  
  <p>The code works fine on my local machine running .NET 4.6.1 but throws <em>System.Security.VerificationException</em> when deployed to the hosting I am using which is running .NET 4.5.</p>
  
  <p><strong>Snipppet from <a href="https://github.com/CollaboratingPlatypus/PetaPoco/blob/development/PetaPoco/Database.cs" rel="nofollow noreferrer">PetaPoco/Database.cs:2253</a></strong></p>
  
  <pre><code>while (true)
  {
      TRet poco;
      try
      {
          if (!r.Read())
              break;
          poco = factory(r, cb); // &lt;-- The exception happens here
      }
      catch (Exception x)
      {
          if (OnException(x))
              throw;
          yield break;
      }
  
      if (poco != null)
          yield return poco;
      else
          bNeedTerminator = true;
  }
  </code></pre>
  
  <p>"cb" is the callback to map the pocos, but for the sake of the argument I made it just return the object that came through: </p>
  
  <pre><code>public Person MapRow(Person person, Category category, Country country) {
      return person;
  }
  </code></pre>
  
  <p>I am calling the method like this:</p>
  
  <pre><code>db.Query&lt;Person&gt;(
     new[] { typeof(Person), typeof(Category), typeof(Country) },
     new PersonRelator().MapRow,
     sql
  );
  </code></pre>
  
  <p>Any clues why this exception is being thrown? </p>