delphiwindows-7iis-7.5isapiisapi-extension

Failed to find the RegisterModule entrypoint in the module DLL... - what's going on?


I have an ISAPI module (native - NO ASP.net etc) written in Delphi XE. Trying to run it on IIS 7.5 on a Win 7 64 enterprise desktop machine.

App pool, webSite, etc are configured correctly, ISAPI module is permissioned to execute, classic pipeline, 32 bit etc - have performed these operations many times.

Same module runs fine on a Win 2008 R2 server and it USED to run on my Win 7 desktop IIS 7.5 as well.

But my hard drive died last week and I got a new Win 7 installation - the standard corporate wide Win 7 Enterprise image (not the same as my previous Win 7 64 installation).

Now when launching the module, browser hangs a bit and then returns "HTTP Error 503. The service is unavailable." In IIS, I see that my app pool is stopped after the error occurs - which I know means a serious error occurred in the web application.

In the windows event log I found this message:

"Failed to find the RegisterModule entrypoint in the module DLL G:\Mikey.dll. The data is the error."

Some debug strings showed me the error surfaces after application.run is called in the DLL dpr.

What's going on here? How can I fix this? I need this deployment for my development work.

Please - the dll is properly permissioned to execute code and the app pool is properly configured - a good deal of my initialization code executes in the DLL BEFORE application.run is called - so this is not a simple configuration or permissions issue - the 503 error and the event log entry also indicate such.


Solution

  • I found the clue to my problem @

    http://forums.iis.net/p/1162012/1921878.aspx

    **

    Re: Messed-up site configuration; "Failed to find the RegisterModule ..." error in Event Log 10-22-2009, 8:48 PM Remove aspnet_isapi.dll from your modules list - it is an ISAPI extension, not a module. Anil Ruia Senior Software Design Engineer IIS Core Server

    **

    Realized that when initially I installed IIS, I did not see the CGI/ISAPI restrictions applet and permissioned my dll in a different fashion.

    Later I found that I had to install the ISAPI support specifically - when I did that I permissioned my DLL again, the right way, and deleted the original module entry (or so I thought).

    This page tipped me off - my dll was probably registered/permissioned incorrectly and IIS was running it as module, not an extension - thus: " "Failed to find the RegisterModule".

    Since this is brand new deployment, I simply uninstalled all IIS modules and features, made sure there were no old config files left around and scrubbed down the registry.

    Then I reinstalled IIS with the ISAPI restriction feature included and registered/permissioned my ISAPI module as required and set up the app pool and web site. Now all is well.

    Thank you Anil Ruia (wherever you are...)