Monday, November 02, 2009

Getting IIS6 working in 32bit mode on a 64bit machine

I had a server up and running hosting various sites.  One of those sites needed to be able to apply DRM wrapping to movies (WMV) files.

Unfortunately the DRM libraries are only available in 32bit versions and it's not possible to call 32bit DLLs from 64 bit processes.  The way round this is to have IIS run in 32 bit mode.

The same applies if  needing to reference any other 32 bit DLLs ffrom 64 bit ASP.NET/IIS.

Based on what I read on the internets, making this change should be quite straight forward.  Despite all the instructions on the web saying ti was just one script to run to make this change I found that more needed to be done.  Incase anyone else has the same problem, here's what I did to get it working.

Uninstall the 64bit version of ASP.NET 2.0.
c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -u

Configure IIS to run in WOW64 mode.
cscript.exe C:\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

Install 32bit version of ASP.NET 2.0
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

Enable 32bit version of ASP.NET 2.0 in IIS WebService Extensions

Recreate the existing websites in IIS using same setings as before.  This will use the 32bit versions of ISAPI extension executables, etc.  I tried changing these manually but that didn't seem to be enough.  I assume that there's more to change than I'm aware of. Recreating the web site takes care of all that for me.


IIS is all or nothing when it comes to using the 32 or 64 bit version.  Yes this meant that all websites on that server needed to be changed to run at 32 bit.  We therefore lose the benefits of the 64bit OS.  If the site becomes as big as the client is hoping we'll move the site doing the DRM wrapping to a different box and put everything back to 64bit so we can make the most of the 12GB of memory installed.

1 comment:

  1. thanks for the tips, I never knew the 32 vs 64 bit problem would affect us poor developers.


I get a lot of comment spam :( - moderation may take a while.