Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7408523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:55:57+00:00 2026-05-29T05:55:57+00:00

I am having a project in which I have my API classes and in

  • 0

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.

From http://www.garethelms.org/2011/05/help-getting-started-with-petapoco/#comment-69, I can see that all the GetSetMethod() are GetSetMethod(true) ever since the petaPOCo is installed.

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.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: meth

Source Error:

Line 1990: } Line 1991: Line
1992: il.Emit(OpCodes.Callvirt,
pc.PropertyInfo.GetSetMethod(true)); // poco Line
1993: Handled = true; Line 1994: }

Source File: C:\Dev\MyProjectTest\Code\API\Models\PetaPoco.cs Line:
1992

Stack Trace:

[ArgumentNullException: Value cannot be null. Parameter name: meth]
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
PetaPoco.d__71.MoveNext() in
C:\Dev\MyProjectTest\Code\API\Models\PetaPoco.cs:765
System.Collections.Generic.List
1..ctor(IEnumerable1 collection) +327
System.Linq.Enumerable.ToList(IEnumerable
1 source) +58
PetaPoco.Database.Fetch(String sql, Object[] args) in
C:\Dev\MyProjectTest\Code\API\Models\PetaPoco.cs:601
PecaTest.NewProject.API.Customer.LoadSortedByName() in
C:\Dev\MyProjectTest\Code\API\Customer.cs:68
PecaTest.NewProject.MvcUI.Models.CustomerListModel..ctor() in
C:\Dev\MyProjectTest\Code\MvcUI\Models\CustomerListModel.cs:14
PecaTest.NewProject.MvcUI.Controllers.CustomerController.GetIndexView()
in
C:\Dev\MyProjectTest\Code\MvcUI\Controllers\CustomerController.cs:82
PecaTest.NewProject.MvcUI.Controllers.CustomerController.Index() in
C:\Dev\MyProjectTest\Code\MvcUI\Controllers\CustomerController.cs:19
lambda_method(Closure , ControllerBase , Object[] ) +96
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase
controller, Object[] parameters) +51
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext
controllerContext, IDictionary2 parameters) +409
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext
controllerContext, ActionDescriptor actionDescriptor, IDictionary
2
parameters) +52
System.Web.Mvc.<>c_DisplayClassd.b_a()
+127 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter
filter, ActionExecutingContext preContext, Func1 continuation) +436
System.Web.Mvc.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c()
+61 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter
filter, ActionExecutingContext preContext, Func
1 continuation) +436
System.Web.Mvc.<>c_DisplayClassf.b_c()
+61 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext
controllerContext, IList1 filters, ActionDescriptor actionDescriptor,
IDictionary
2 parameters) +305
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext
controllerContext, String actionName) +830
System.Web.Mvc.Controller.ExecuteCore() +136
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
+111 System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext
requestContext) +39
System.Web.Mvc.<>c_DisplayClass8.b_4() +65
System.Web.Mvc.Async.<>c_DisplayClass1.b_0() +44
System.Web.Mvc.Async.<>c__DisplayClass81.<BeginSynchronous>b__7(IAsyncResult
_) +42 System.Web.Mvc.Async.WrappedAsyncResult
1.End() +140 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
Object tag) +54
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,
Object tag) +40
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
+52 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
result) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+8969117 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

——————————————————————————– Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.272


Customer class

` 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;
    }

`

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:55:58+00:00Added an answer on May 29, 2026 at 5:55 am

    The issue was indeed with the POCO as I missed to set and get the ID

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a project which will have country dropdown at the top to
I'm having to grab API-provided JSON for a project of mine, and that means
I have a project in which I have a database model class provided along
I'm having to interact with the Facebook API for this project, which I find
I have a small project that basically a Python wrapper to a websites API.
I am having a strange error in my android project. I have integrated Facebook
Having a project with following requirements in mind. data reading intensive application. 100 max
Over the years I have vacillated between having my project/source folders in a directory
I'm trying to compile existing Flex 4 project but having an error: Call to
I'm trying to use MVC for a new project after having been around the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.