Running a 32 bit web application in IIS 8 with SharePoint 2013

By default, IIS running on a 64 bit computer does not support running a 32 bit application. However, you can change the setting in an Application Pool under which the application is running by setting the ‘Enable 32-bit Applications‘ to true. Or you can use the enable32BitAppOnWin64 to enable the 32 bit web applications on IIS running on a 64 bit computer.

IIS 32 bit application

Sounds simple enough. As per documentation, I created a new web-site in IIS and change the application pool to enable 32-bit application. Big deal!

Well, not so soon. I noticed that when I tried to visit the application it gives me HTTP Error 503. The service is unavailable. error.

IIS 32 bit application Error 503. The service is unavailable.

Considering that it might have been one time hick-up, I restarted the IIS and tried again. No luck and what I noticed that the application pool was stopped repeatedly as soon as I access the application. Checking the event logs showed the following error:

The Module DLL ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\isapi\spnativerequestmodule.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 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.

Strange! This was a new application I created and had nothing to do with SharePoint. Except that the machine on which I was running this application also had SharePoint 2013 installed.

IIS 32 Bit SharePoint

Solution

In IIS 8, all the global (i.e. loaded into every AppPool) native ISAPI modules are loaded from the GlobalModules section. However this can be changed as IIS fully supports conditionally loading an ISAPI module depending on if its a 32 or 64 bit, managed or classic pipeline or even specific Web Application’s.

Run the following command using the Windows Command Prompt. This would basically direct the SPNativeRequestModule to only be loaded when the application pool is running in Integrated Mode and 64-bit application mode.


"%systemroot%\system32\inetsrv\AppCmd.exe" set config -section:system.webServer/globalModules /[name='SPNativeRequestModule'].preCondition:integratedMode,bitness64
  • Leo

    Thanks… It simply worked..

  • Waly

    Hi, I’m running my SharePoint site under windows 8 platform. After execute the instruction, it throws: “cannot find requested collection element”

    • Hi Waly,

      You might have already resolved this. If not, you need to elaborate.

      However, it’s really not recommended to SharePoint on a Client Operating system like Windows 8.

  • Chris

    You saved my day!! Need to run a Web Api 2 application which needs to get data from 32bit ODBC on the same box..

    • Hi Chris,

      Thanks for your comment and glad it helped 🙂

      Cheers, Manas

  • Arash Vezvaei

    Thanks man! just wasted 20 precious hours on the friggin’ problem!

    Who the ‘F’ could guess that sharepoint could do that to other websites?!!!!

    • Nice to know that it worked for your Arash.

      And well, SharePoint can do a lot of these things ;).

      • Arash Vezvaei

        I have absolutely zero experience with SharePoint and had to install it because of TFS. So, I really had no idea what was going on and why my other sites didn’t work anymore 🙁

        Thanks anyway.

  • Vusi Mtimkulu

    Hey Manas, would you happen to know where “web service extension(s)” can be added
    in IIS 8

  • stoqn

    4 hours debugging today on why this was happening and you helped me out! Thanks man! Saved me a ton of headaches.

  • David Kotyza

    You saved my life! Thank you soooo much!

  • NewsMaster69

    YOU ARE THE MAN!!!!….. Thanks so much for this…. I will literally have your babies for this fix!

    • Glad that this helped you and wow, that’s some way to say thanks 😉

  • David Lohnes

    This right here is some genius.
    Problem solved.

  • David Truong

    Thank you very much!! You saved my day.