Running 32 bit ASP.Net applications on a 64bit OS

Here's a thing that haunted me the last few days:

I have this 64bit Windows Server 2K8 machine which I'm trying to convince to run 32bit code under IIS7. In the same time I have a 64bit Windows Server 2K3 on which I'm trying to do the same.

After bumping my head into walls for some time I found out this nice description of how to solve the problem for IIS 6:
http://support.microsoft.com/kb/894435
Mainly the trick is to be able to register the 32bit framework (running aspnet_regiis fails)... so the solution goes like this:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
%SYSTEMROOT%\Microsoft.NET\Framework\<version>\aspnet_regiis.exe -i

Now the bad thing is that you would need to turn it off if you want to run 64 bit applications under ASP.Net.

On IIS7 this problem is solved (you can run them both) but the solution to have it working is different than what was for II6:
http://blogs.msdn.com/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx
This blog will show in details how to do it so on IIS7 you could run both 32 and 64 bit ASP.Net applications.
If you need the short fast version, for 32bit you need to go to the application advanced properties page and just flip a flag "Enable 32Bit applications" from False to True.

Wasn't that easy? (Once you found it...)

Thanks,
Ionutz