I recently came across an interesting new variation of "failure" related to enabling WOW64 that can happen on IIS6 on 64bit Windows... so I am going to explain what happened and how to fix it.
Hi,
I ran into an issue with IIS in wow64 mode. On this machine I consistently get an error trying to turn on wow64 mode.
I turn on wow64 mode in IIS, do IISReset, and then when I run “aspnet_regiis –I –enable” from the 32-bit directory, I get an error in the log file:
2005-12-14 12:37:39 Failure Waiting for service to start: WaitForServiceState failed with HRESULT 8007041d: 'The service did not respond to the start or control request in a timely fashion. ' 2005-12-14 12:37:40 Failure Starting service: w3svc: StartServiceByName failed with HRESULT 8007041d: 'The service did not respond to the start or control request in a timely fashion. ' 2005-12-14 12:37:40 Failure Restarting W3SVC: RestartW3svc failed with HRESULT 8007041d: 'The service did not respond to the start or control request in a timely fashion. '
If I check the w3svc service, it is stopped. If I try to start it, I get:
The World Wide Web Publishing Service service is starting.The World Wide Web Publishing Service service could not be started.
A system error has occurred.
System error 193 has occurred.
*** is not a valid Win32 application.
If I check the EventVwr, I get:
Could not load all ISAPI filters for site/service. Therefore startup aborted.
ISAPI Filter 'd:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll' could not be loaded due to a configuration problem. The current configuration only supports loading images built for a AMD64 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.
This error makes no sense to me, because at this point IIS is in wow64 mode, so it should not have any problems loading the 32-bit aspnet_filter.dll.
I double-checked that wow64 mode is turned on:
Enable32BitAppOnWin64 : (BOOLEAN) True
Do you know what could be causing this?
Hmm... this issue is indeed interesting because all the rules for running IIS6 in WOW64 mode, as explained in this blog entry, were obeyed... except for one little detail that I did not mention earlier, though it is definitely there in MSDN documentation:
WOW64 mode is only valid when IIS6 is running in Worker Process Isolation Mode.
In particular, WOW64 mode is not valid when IIS6 is running in IIS5 Compatibility Mode. Now, we can argue over the philosophical oxymoron where "IIS5 never existed as 64bit" and "IIS6's IIS5 Compatibility Mode on 64bit Windows only runs as 64bit", but let's not sidetrack ourselves here... ;-)
What happened in this situation is that IIS6 is simultaneously configured to run in IIS5 Compatibility Mode (W3SVC/IIs5IsolationModeEnabled=1) AND WOW64 mode (W3SVC/AppPools/Enable32BitAppOnWin64=1). This is actually an invalid IIS configuration, but due to the sequence of configuration events, an interesting failure condition occurrs - W3SVC fails to start up due to Win32 Error 193 when it never loads the bitness-mismatched user binary. Here is what happens:
%SYSTEMROOT%\System32\inetsrv\metabase.xml
%SYSTEMROOT%\System32
ASPNET_REGIIS.EXE -I -Enable
W3SVC/Filters/ASP.Net_2.0.50727.42/FilterPath
%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll
In this case, the fix is to resolve the invalid configuration of attempting to run IIS5 Isolation Mode and WOW64 simultaneously. Either choose to run in IIS5 Compatibility Mode and keep things 64bit, or run in IIS6 Worker Process Isolation Mode with WOW64. Due to the oxymoron stated earlier, I suspect that 99.9% of the time you will choose to run in IIS6 Worker Process Isolation Mode with WOW64. I mean, 64bit ISAPI Filter which requires ReadRawData is rare commodity, most likely generated by self-interest. :-)
This means that you should run the following:
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs SET W3SVC/IIs5IsolationModeEnabled 0 NET STOP HttpFilter /y NET START W3SVC
To switch IIS6 back into Worker Process Isolation Mode, and since you already have WOW64 enabled and 32bit DLLs correctly configured, things should just work... assuming you covered all other bases regarding WOW64 and possible bitness mismatch mentioned in my prior blog entries.
//David