Windows Server 2003 64bit, IIS 6 32bit, ASP.Net 4 Framework, and Targeting

This article is nothing but a hat tip (HT) to my buddy Ben at work for his awesome work.

Here’s the rundown. There is a server at work that is running Windows Server 2003 x64 with IIS 6 and and .Net 4 Framework. Due to an existing application on the server, IIS has to run in 32bit mode. Ben had recently put a new web application on the server, which needed to use the .Net 4 Framework. Since the server was initially setup with the .Net 2.0 Framework, the new application defaulted to the 2.0 Framework. Typically you can go to the IIS settings for the application and use the ASP.Net tab to re-target the appropriate Framework. But for some reason, when he went into IIS to set the properties on the Virtual Directory/Web Application, the ASP.Net tab was missing.

After a LOT of digging, head beating against the wall, and some good thinking, he wasn’t able to get the tab to appear, but he was able to get the application to retarget the proper framework by doing the following:

1. Open up the command prompt on the server and figure out how IIS is running by executing the following command:

cscript C:\inetpub\adminscripts\adsutil.vbs GET W3SVC/AppPools/Enable32BitAppOnWin64

2. You should see ‘Enable32BitAppOnWin64 : (BOOLEAN) True.’

3 Is the server setup for 32-bit compatibility mode for legacy apps? If not execute the following command:

cscript C:\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32BitAppOnWin64 True

4. Assuming it has been installed, make sure .Net 4 Framework is registered for ASP.Net by executing:

aspnet_regiis -i

5. Find out what IIS extensions are enabled (0) and disabled (0) by executing teh following command:

C:\Windows\System32 “cscript iisext.vbs /ListFile

6. If the .Net 4 Framework is disabled you will need to run the following command:

cscript iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll

and verify that you now see a ‘1’ in the status of the desired Framework.

7. Now navigate to your Framework version folder and run the following command:

aspnet_regiis -lv

to list the status and installation path of all versions of ASP.NET that are installed on the computer. Notice the (Root) note that specifies this is the default Framework.

8. Execute the following command:

aspnet_regiis -lk

to list the path and version of all IIS metabase keys where ASP.NET is mapped.

9. Note in the attached image that the desired application DSMapApp is still targeting the 2.0 framework EVEN THOUGH running aspnet_regiis -i is supposed to switch all apps to the specified Framework.

10. To switch a particular application’s targeted Framework we’ll need the -s switch to Update scriptmaps and application-pool assignments for the specified application and for all sub-applications.:

aspnet_regiis -s W3SVC/1/Root/[AppName]

…and that should do it. The following screen shot below traces the commands executed.

Mad props to you Ben!


IIS Configuration Script Log
Transaction Log
IIS Configuration Screen Results
Final Verification in IIS Screen


15 thoughts on “Windows Server 2003 64bit, IIS 6 32bit, ASP.Net 4 Framework, and Targeting

  1. Just an addendum – there is a way to get the tab to reappear by setting the Enable32bitAppOnWin64 to false but this really doesn’t help if you’re running IIS in 32-bit compatibility mode (because you wouldn’t be anymore) :P

    Thanks for seeding this!!

  2. Thank you SO much for this post. We were having this same problem and I chuckled a little bit when I saw the attached screenshot. We were having this EXACT same problem trying to get ArcGIS and our mapping app to work on IIS6 32-bit.

  3. what a nice solution it is!i like this solution.but i have gotten a best solution in other browser site.this site below.
    In my workstation I have used 32bit PC. There is no problem every this is working nice. But an unexpected situation arise recently when I try to deploy my application in to a 64 bit windows server. I never face this problem before….more

  4. I am trying to deploy 4.0 (crystal report) website on 64 bit windows server 2003 with IIS 6.0.

    This is a web site application not a web project. I get Front page extension error when i deploy my site to this remote server 2003.

    I have tried to install FPE and then followed this link to enable IIS on 32 bit but then i can’t see tab in IIS.

    I am now able to publish 4.0 website but can’t see .net tab in IIS.

    1. Hmm, unfortunately I’m a little stuck on what to do in this paticular case. Have you tried going through the steps above now that FPS is working for you?

  5. I’ve been trying to solve this for two hours now, and this stupid little line from step 10 is all I needed.

    Just to pay it back a little, for those of you who want to put it into a batch file, just save this as reg40.bat and call it as reg40 (your application name):

    C:\windows\\framework\v4.0.30319\aspnet_regiis -s W3SVC/1/Root/%1

    Thanks, Sean.

What are your 10 bits on the matter? I want to know!

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.