Welcome to MSDN Blogs Sign in | Join | Help

IIS7 - Running 32-bit and 64-bit ASP.NET versions at the same time on different worker processes

In IIS6, this was a pain area. On a 64-bit Windows 2003 Server, you cannot run worker processes in both 32-bit mode and as well as 64 bit mode. Either only one of them was possible. This was possible by the below Metabase Key which would be applied to the W3SVC/AppPools node.

W3SVC/AppPools/enable32BitAppOnWin64 : true | false

Read more how to do this in IIS 6.0 here. But, in IIS7, you can run 32-bit and 64-bit worker processes simultaneously. Let’s see how to do it.

You have the same enable32BitAppOnWin64 property for the applicationPools in the applicationHost.config. Now, you can set this for individual application pools. Below is my sample configuration:

<applicationPools>
 <add name="MyAppPool32bit" autoStart="true" enable32BitAppOnWin64="true" />
 <add name="MyAppPool64bit" autoStart="true" enable32BitAppOnWin64="false" />
  <applicationPoolDefaults>
   <processModel identityType="NetworkService" />
  </applicationPoolDefaults>
</applicationPools>

Below is how you do it from IIS7 manager:

  1. Right click on the Application Pool and select “Advanced Settings…” or select the same from the Actions pane after selecting the Application pool
  2. Change the “Enable 32-bit Applications” to True (if you want the application pool to spawn in a 32-bit mode)
  3. Click OK

Below is how you do from the AppCmd:

appcmd apppool set /apppool.name:MyAppPool32bit /enable32BitAppOnWin64:true

appcmd apppool set /apppool.name:MyAppPool32bit /enable32BitAppOnWin64:false

NOTE : By default, it is false.

Most of you may already know how to see if the process is really spun in a 32-bit mode in 64-bit OS. Yes, simple way is to open the Task Manager and go to Processes tab – you would see the below:

Now, you may ask how does the correct version of the DLLs picked up automatically. Open your applicationHost.config and search for aspnet_filter. You would see the below:

<isapiFilters>
    <filter name="ASP.Net_2.0.50727.0" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness32" />
    <filter name="ASP.Net_2.0.50727-64" path="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness64" />
</isapiFilters>

The preCondition="bitness32" or "bitness64" decides which ISAPI Filter to pick up for corresponding modes. Same case with any DLL used, for example ISAPI Filter, Modules, etc.

Happy Learning!

Published Saturday, November 03, 2007 3:00 PM by rakkim
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Running x86 and x64 Web Apps Side-by-Side on IIS7

Rakki Muthukumar is a Microsoft Developer Support Engineer for ASP.NET and IIS7. If you haven't seen

Saturday, November 03, 2007 2:49 PM by Robert McLaws: Windows Vista Edition

# re: IIS7 - Running 32-bit and 64-bit ASP.NET versions at the same time on different worker processes

Wow, this is cool stuff.

Good info on IIS7

Sunday, November 04, 2007 2:46 PM by Saurabh Singh

# IIS7 in the Community...11/7/2007

The IIS7 community is growing!&#xA0; There have been a number of really cool things going on in the community

Wednesday, November 07, 2007 5:32 PM by BillS' IIS Blog

# IIS7 in the Community...11/7/2007

The IIS7 community is growing!&amp;#xA0; There have been a number of really cool things going on in the

Wednesday, November 07, 2007 11:44 PM by Noticias externas

# Nov 17th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, VS 2008, .NET 3.5, IIS7, Silverlight

Nov 17th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, VS 2008, .NET 3.5, IIS7, Silverlight

Wednesday, February 27, 2008 12:33 PM by rox19840702

# 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

Monday, April 07, 2008 5:29 PM by Ionutz's tech blog

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker