64位的系统可以让IIS在32位的环境下运行asp.net程序,设置方法如下:
ASP.NET程序在编译的时候默认是Any CPU,即编译的程序可以在X86、X64系统平台上运行。若希望我们的ASP.NET程序运行在X64系统上,我们所要做的仅仅是部署IIS,修改配置。
若想程序运行于IIS32位模式下,即运行在.net framwork32位下进行如下配置:
1.cscript %systemdrive%\inetpub\adminscripts\adsutil.vbs set w3svc/appPools/enable32bitapponwin64 1 修改IIS配置,允许32位程序运行
2.C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i 为IIS注册asp.net32。注册后在IIS的web扩展里显示的是Asp.net2.0.*32bit。
3.Web扩展里允许 Asp.net2.0.*32bit运行。运行的是w3wp32.exe进程。
二.64位模式
1.cscript %systemdrive%\inetpub\adminscripts\adsutil.vbs set w3svc/appPools/enable32bitapponwin64 0 默认就是0,若原来运行了32位程序,则需要重新设置为0。
2.C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis -i 为IIS注册64为Asp.NET。注册了64位ASP.NET的IIS在Web扩展里显示的是Asp.net2.0.*。
3.Web扩展里允许 Asp.net2.0.*运行。运行的是w3wp.exe进程。
-----------------老外说的比较详细----------------
Running IIS 32-bit Applications on IIS 64-bit
Do you have IIS on Windows 64 bit and want to run application that is for 32 bit. No problem. From the Inetpub admin scripts run the following:
"cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true"
Here are the details.
Windows Server 2003TM, Service Pack 1 enables IIS 6.0 to run 32-bit Web applications on 64-bit Windows using the Windows-32-on-Windows-64 (WOW64) compatibility layer. IIS 6.0 using WOW64 is intended to run 32-bit personal productivity applications needed by software developers and administrators, including 32-bit Internet Information Services (IIS) Web applications.
On 64-bit Windows, 32-bit processes cannot load 64-bit DLLs, and 64-bit processes cannot load 32-bit DLLs. If you plan to run 32-bit applications on 64-bit Windows, you must configure IIS to create 32-bit worker processes. Once you have configured IIS to create 32-bit worker processes, you can run the following types of IIS applications on 64-bit Windows:
* Internet Server API (ISAPI) extensions
* ISAPI filters
* Active Server Page (ASP) applications (specifically, scripts calling COM objects where the COM object can be 32-bit or 64-bit)
* ASP.NET applications
IIS can, by default, launch Common Gateway Interface (CGI) applications on 64-bit Windows, because CGI applications run in a separate process.
Before you configure IIS to run 32-bit applications on 64-bit Windows, note the following:
* IIS only supports 32bit worker processes in Worker Process Isolation mode on 64-bit Windows
* On 64-bit Windows, the World Wide Web Publishing service can run 32-bit and 64-bit worker processes. Other IIS services like the IIS Admin service, the SMTP service, the NNTP service, and the FTP service run 64-bit processes only
* On 64-bit Windows, the World Wide Web Publishing service does not support running 32-bit and 64-bit worker processes concurrently on the same server
------------------个人实战结果
当在64位环境下运行32的asp.net程序时,一些原来需要放在system32目录下的文件,需要放在C:\WINDOWS\SysWOW64目录下了,这是虚拟32位坏境而产生的虚拟system32目录,此目录下放置32位的dll。asp.net的bin目录下也放置32位版本的dll。