title: Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: meth when running
body: <p>I am having a project in which I have my API classes and in that project I have generated the Database.cs.  In my MVC project I have refenrenced the API. Uppon running the application I am having the error message as follows, can anyone help please as I can`t understand why I am having this error message.   </p>
  
  <p>From <a href="http://www.garethelms.org/2011/05/help-getting-started-with-petapoco/#comment-69" rel="noreferrer">http://www.garethelms.org/2011/05/help-getting-started-with-petapoco/#comment-69</a>, I can see that all the GetSetMethod() are  GetSetMethod(true) ever since the petaPOCo is installed.</p>
  
  <blockquote>
    <p>Value cannot be null. Parameter name: meth  Description: An unhandled
    exception occurred during the execution of the current web request.
    Please review the stack trace for more information about the error and
    where it originated in the code. </p>
    
    <p>Exception Details: System.ArgumentNullException: Value cannot be null.
    Parameter name: meth</p>
    
    <p>Source Error: </p>
    
    <p>Line 1990:                                        } Line 1991: Line
    1992:                                     il.Emit(OpCodes.Callvirt,
    pc.PropertyInfo.GetSetMethod(true));      // poco Line
    1993:                                     Handled = true; Line 1994:                                  }  </p>
    
    <p>Source File: C:\Dev\MyProjectTest\Code\API\Models\PetaPoco.cs    Line:
    1992 </p>
    
    <p>Stack Trace: </p>
    
    <p>[ArgumentNullException: Value cannot be null. Parameter name: meth]<br>
    System.Reflection.Emit.DynamicILGenerator.Emit(OpCode opcode,
    MethodInfo meth) +9492330    PetaPoco.PocoData.GetFactory(String sql,
    String connString, Boolean ForceDateTimesToUtc, Int32 firstColumn,
    Int32 countColumns, IDataReader r) in
    C:\Dev\MyProjectTest\Code\API\Models\PetaPoco.cs:1992<br>
    PetaPoco.d__7<code>1.MoveNext() in
    C:\Dev\MyProjectTest\Code\API\Models\PetaPoco.cs:765<br>
    System.Collections.Generic.List</code>1..ctor(IEnumerable<code>1 collection) +327
    System.Linq.Enumerable.ToList(IEnumerable</code>1 source) +58<br>
    PetaPoco.Database.Fetch(String sql, Object[] args) in
    C:\Dev\MyProjectTest\Code\API\Models\PetaPoco.cs:601<br>
    PecaTest.NewProject.API.Customer.LoadSortedByName() in
    C:\Dev\MyProjectTest\Code\API\Customer.cs:68<br>
    PecaTest.NewProject.MvcUI.Models.CustomerListModel..ctor() in
    C:\Dev\MyProjectTest\Code\MvcUI\Models\CustomerListModel.cs:14<br>
    PecaTest.NewProject.MvcUI.Controllers.CustomerController.GetIndexView()
    in
    C:\Dev\MyProjectTest\Code\MvcUI\Controllers\CustomerController.cs:82<br>
    PecaTest.NewProject.MvcUI.Controllers.CustomerController.Index() in
    C:\Dev\MyProjectTest\Code\MvcUI\Controllers\CustomerController.cs:19<br>
    lambda_method(Closure , ControllerBase , Object[] ) +96<br>
    System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase
    controller, Object[] parameters) +51<br>
    System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext
    controllerContext, IDictionary<code>2 parameters) +409<br>
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext
    controllerContext, ActionDescriptor actionDescriptor, IDictionary</code>2
    parameters) +52<br>
    System.Web.Mvc.&lt;>c_<em>DisplayClassd.b</em>_a()
    +127    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter
    filter, ActionExecutingContext preContext, Func<code>1 continuation) +436<br>
    System.Web.Mvc.&lt;&gt;c__DisplayClassf.&lt;InvokeActionMethodWithFilters&gt;b__c()
    +61    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter
    filter, ActionExecutingContext preContext, Func</code>1 continuation) +436<br>
    System.Web.Mvc.&lt;>c_<em>DisplayClassf.b</em>_c()
    +61    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext
    controllerContext, IList<code>1 filters, ActionDescriptor actionDescriptor,
    IDictionary</code>2 parameters) +305<br>
    System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext
    controllerContext, String actionName) +830<br>
    System.Web.Mvc.Controller.ExecuteCore() +136<br>
    System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
    +111    System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext
    requestContext) +39<br>
    System.Web.Mvc.&lt;>c_<em>DisplayClass8.b</em>_4() +65<br>
    System.Web.Mvc.Async.&lt;>c_<em>DisplayClass1.b</em>_0() +44<br>
    System.Web.Mvc.Async.&lt;>c__DisplayClass8<code>1.&lt;BeginSynchronous&gt;b__7(IAsyncResult
    _) +42    System.Web.Mvc.Async.WrappedAsyncResult</code>1.End() +140    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
    Object tag) +54<br>
    System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
    Object tag) +40<br>
    System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
    +52    System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
    result) +38<br>
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    +8969117    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +184</p>
    
    <p>-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319;
    ASP.NET Version:4.0.30319.272</p>
  </blockquote>
  
  <hr>
  
  <p>Customer class</p>
  
  <pre><code>` private int id = 0;
      public  int ID
      {
          get { return id; }
          set { id = ID; }
      }
  
      protected string name;
      public Customer() { }
  
      public Customer(string name)
      {
          this.name = name;
      }
  
      public string Name
      {
          get { return name; }
          set { name = value; }
      }
  
      public override string ToString()
      {
          return name;
      }
  </code></pre>
  
  <p>`</p>