03 November 2007

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!

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

# Robert McLaws: Windows Vista Edition said:

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

03 November 07 at 2:49 PM
# Saurabh Singh said:

Wow, this is cool stuff.

Good info on IIS7

04 November 07 at 2:46 PM
# BillS' IIS Blog said:

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

07 November 07 at 5:32 PM
# Noticias externas said:

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

07 November 07 at 11:44 PM
# rox19840702 said:

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

27 February 08 at 12:33 PM
# Ionutz's tech blog said:

Here's a thing that haunted me the last few days: I have this 64bit Windows Server 2K8 machine which

07 April 08 at 5:29 PM
# Try-Catch-FAIL said:

Useful Info: Running x64 and x86 IIS Worker Processes Side-By-Side

29 July 08 at 11:50 AM
# Try-Catch-FAIL said:

Useful Info: Running x64 and x86 IIS Worker Processes Side-By-Side

29 July 08 at 11:52 AM
# Darren Sandford said:

Some installer that I ran recently broke my Virtual Server configuration page - all I got was a IIS error.

Turns out that it added an extra element into my "isapiFilter" element:

   <filter name="ASP.Net_2.0.50727.0" path="C:\Windows\Microsoft.NET\Framework\v2.0.50727\\aspnet_filter.dll" enableCache="true" />

Hard-coded path, and with the "bitness" filter removed.  As virtual server is 64 bit, it broke it.

I deleted the line, and all is now well!

04 August 08 at 6:03 AM
# Half Blood Programmer, MSFT Chapter said:

This posting is provided "AS IS" with no warranties, and confers no rights. Well, I guess most ASP.NET

28 November 08 at 4:40 AM
# LavaBlast Software Blog said:

Gotchas: Migration from IIS6 SQL 2005 (32-bit) to IIS7 SQL 2008 (64-bit)

12 January 09 at 10:51 AM
# Mubashir said:

Thanks for the post, it helped me in resolving the case. :)

BINGO

01 May 09 at 7:10 PM

Leave a Comment

Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.

(required) 
(optional)
(required) 
Page view tracker