且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

system.missingMethodException而:找不到方法?

更新时间:2023-11-21 23:11:40

这是当有一个旧版本的DLL中仍徘徊在某处可能出现的问题。确保最新的程序集部署,没有重复旧的组件中的某些文件夹藏匿。***的办法是删除每一个项目建成,重建/重新部署整个解决方案。

My asp.net webforms app was working fine until this morning. Now it throws this error?? The DoThis is on the same class so should work?

I have a generic handler which contains:

public class MyHandler: IHttpHandler
{
    public void Proces-s-request(HttpContext context)
    {
        switch (somepage)
        {
            case "page1.aspx"
                this.DoThis(); // throws error now System.MissingMethodException: Method not found?

        }
    }

    public void DoThis()
    {
    //
    }
}

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.