System.MissingMethodException: Method not found?

user603007 picture user603007 · Nov 9, 2011 · Viewed 292.8k times · Source

What once was working in my asp.net webforms app now throws this error:

System.MissingMethodException: Method not found

The DoThis method is on the same class and it should work.

I have a generic handler as such:

public class MyHandler: IHttpHandler
{
    public void Processrequest(HttpContext context)
    {
      // throws error now System.MissingMethodException: Method not found?
      this.DoThis(); 
    }

    public void DoThis()
    {
    //
    }
}

Answer

Polity picture Polity · Nov 9, 2011

This is a problem which can occur when there is an old version of a DLL still lingering somewhere around. Make sure that the latest assemblies are deployed and no duplicated older assemblies are hiding in certain folders. Your best bet would be to delete every built item and rebuild/redeploy the entire solution.