Udostępnij za pośrednictwem


Getting System.MissingMethodException: Method not found

PROBLEM DESCRIPTION:

=====================

One of my customers was trying to redefine the caption property of his datagrid and was getting the following error message

System.MissingMethodException: Method not found: Void System.Web.UI.WebControls.BaseDatalist.set_Caption(System.String)

TROUBLESHOOTING DONE:

=======================

-          The customer was on RTM version of 1.1 framework and the Caption property of the datagrid wasn’t listing in the RTM version.

-          I had him install the SP1 for 1.1 framework first. After the installation we started seeing new errors. Every time he requests for the page, JIT compilation pops up with error. The JIT debugging was throwing even if he opened any ASP.NET application from Visual Studio

An exception 'System.ExecutionEngineException' has occured in /LM/w3svc/1/root/WebApplication1-1-127917872678381664.

-          If I cancel the JIT debugging I get

Server application unavailable

-          If I start debugging, I get

A first chance exception of type 'System.ExecutionEngineException' of module Unknown was thrown

-          I then looked at the version of the System.Web.dll and I saw it had much higher version than the SP1, it was on 1.1.4322.2047!!

-          When I asked him if he is aware how the version for this dll is higher he told me that searched in internet and came to know that the caption works in the latest versions of System.Web.dll and doesn’t work on RTM

-          So he had copied the file from his colleague's box that had the latest SP and had the caption property working on his machine.

-          Replacing the dll with the RTM version and then re-applying the SP1 fixed the issue for us.

CAUSE

======

The customer had copied the latest version of System.Web.dll from some other server to his web server.

The issues were happening due to mismatched version of the System.Web.dll file.

It is not advisable to copy any framework files to get the latest version; it needs to be installed via a service pack or a hotfix.