Running Applications in 64-bit Mode

Iron Speed Designer Version 6.1 creates code that will work in either 32-bit or 64-bit mode without any change.  When you run your application on a 64-bit machine, there are three factors that determine whether your application is running under 32-bit or 64-bit mode:

Running Microsoft IIS in 64-bit mode

You can easily identify whether Microsoft IIS is running in 32-bit mode or 64-bit mode by looking at the Processes in the Task Manager.  The w3wp.exe will show *32 next to the image name if the World Wide Web (w3) worker process (wp) is running in 32-bit mode.

If no *32 is shown next to the image name, then the worker process is running in 64-bit mode.

To run the 64-bit version of Microsoft IIS:

Step 1:  Click Start, click Run, type cmd, and then click OK.

Step 2:  Type the following command to disable the 32-bit mode:

cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0

Step 3:  Type the following commands to install the version of ASP.NET 2.0 and to install the script maps at the IIS root and under:

%SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -u

%SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i

%SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -c

Step 4:  Make sure that the status of ASP.NET version 2.0. 50727 is set to Allowed in the Web service extension list in Internet Information Services Manager.

The build version of ASP.NET 2.0 may differ depending on the currently released build version. These steps are for build version 2.0. 50727.

To restore the 32-bit version of Microsoft IIS:

Step 1:  Click Start, click Run, type cmd, and then click OK.

Step 2:  Type the following command to enable the 32-bit mode:

cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

Step 3:  Type the following commands to install the version of ASP.NET 2.0 and to install the script maps at the IIS root and under:

%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -u

%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -c

Step 4:  Make sure that the status of ASP.NET version 2.0. 50727 (32-bit) is set to Allowed in the Web service extension list in Internet Information Services Manager.

The build version of ASP.NET 2.0 may differ depending on what the currently released build version is. These steps are for build version 2.0. 50727.

Configuring Application Pools (Microsoft IIS 7 only)

On a 64-bit Windows 2003 Server, you cannot run worker processes in both 32-bit mode and as well as 64 bit mode. On machines that run IIS 7 such as Windows Vista or Windows 2008 server, you can configure IIS to run either a 32-bit application or a 64-bit application.  More information about enabling both 32-bit and 64-bit is described at:

http://www.codedigest.com/Articles/IIS/21_IIS7_-_Running_32-bit_and_64-bit_ASPNET_versions_at_the_same_time_on_different_worker_processes.aspx

Configuring your application for 64-bit operation

After Microsoft IIS and the Application Pools are configured to run in 64-bit, you will need to ensure that all of the DLL’s that are in the Bin folder of an application are in 64-bit mode.  If you have the Visual Studio solution file, you can verify the configuration under the Build menu to ensure that the build configuration is set to “Any CPU”.  All DLL’s shipped with Iron Speed Designer Version 6.1 or later are compiled in “Any CPU” mode so they will run in either 32-bit or 64-bit mode.

There is absolutely no difference in either the application code or in the DLL’s between the 32-bit or 64-bit mode.

You can verify whether your application is running in 64-bit mode by creating a sample file called Test64Bit.aspx with the following code:

<%@ Page Language="cs" AutoEventWireup="false"  Debug="true" %>

<%

    if (IntPtr.Size == 8) {

     Response.Write("Running in 64-bit mode.  Int size=" + IntPtr.Size.ToString());

    } else {

     Response.Write("Running in 32-bit mode.  Int size=" + IntPtr.Size.ToString());

    }

%>

The above code checks to see the size of the Integer pointer.  If the size is 8 bits, the application is running in 64-bit mode, and if it is 4-bits, the application is running in 32-bit mode.

Running this page from your application will display a web page such as:

See Also

Configuring the Microsoft IIS Web Server

Configuring Microsoft IIS 7 for Microsoft Access Applications

Configuring Microsoft IIS on Microsoft Vista

Running as Administrator in Microsoft Vista

Installing Microsoft IIS on Microsoft Windows XP Professional

Installing Microsoft IIS on Windows Server 2003

Using Non-Standard Ports in Microsoft IIS

Application Pools in Microsoft IIS

Running Applications in 64-bit Mode