IIS 6.0 64 位:SysInterals Proc Explorer 显示已加载 32 位 DLL?
尝试确定一个问题,该问题很可能是由于我们的 Web 应用程序在 IIS 以 64 位运行时尝试加载 32 位版本的 OracleAccess.dll(看起来既是 32 位版本又是 64 位版本) Oracle 驱动程序可以并行安装)。
我的服务器上有两个站点,一个用于生产,一个用于测试。生产代码中的代码是由一位不再在我们这里工作的员工部署的。那个网站有效。我们刚刚部署的另一个站点;它是针对任何 CPU
进行编译的,我们在加载 Oracle 驱动程序时遇到错误。
如果我在 SysInternal 的进程资源管理器中查看生产站点的 IIS 工作进程,突出显示 IIS 工作进程,并在下部窗格视图中查看加载的 DLL,我会看到一些奇怪的数据。
工作进程的信息:
Process Version User Name PID Image Type
w3wp.exe 6.0.3790.3959 NT AUTHORITY\NETWORK SERVICE 3320 64-bit
但是在加载的DLL列表中,有些被列为64位图像,有些被列为32位图像? (据我所知)不可能将 32 位 DLL 加载到 64 位进程空间中,所以也许我不理解我看到的报告。
DLL 句柄信息的子集:
Name Image Type Description Company Name Version
aspnet_filter.dll 64-bit Microsoft ASP.NET ISAPI Filter DLL Microsoft Corporation 4.0.30319.1
admwprox.dll 64-bit IIS Admin Com API Proxy dll Microsoft Corporation 6.0.3790.3959
adsldp.dll 64-bit ADs LDAP Provider DLL Microsoft Corporation 5.2.3790.3959
adsldpc.dll 64-bit ADs LDAP Provider C DLL Microsoft Corporation 5.2.3790.3959
advapi32.dll 64-bit Advanced Windows 32 Base API Microsoft Corporation 5.2.3790.4555
aspnet_filter.dll 64-bit Microsoft ASP.NET ISAPI Filter DLL Microsoft Corporation 4.0.30319.1
aspnet_isapi.dll 64-bit Microsoft ASP.NET ISAPI Shim DLL Microsoft Corporation 2.0.50727.3053
comctl32.dll 64-bit Common Controls Library Microsoft Corporation 5.82.3790.4770
comctl32.dll 64-bit User Experience Controls Library Microsoft Corporation 6.0.3790.4770
comres.dll 64-bit COM+ Resources Microsoft Corporation 2001.12.4720.3959
(Next few are our DLLs)
CSA.Database.DLL 32-bit CSA.Database TE 1.7.8221.0
CSA.Database.DLL 32-bit CSA.Database TE 1.7.8221.0
CSA.Loggers.DLL 32-bit CSA.Loggers TE 1.7.8221.0
CSA.Loggers.DLL 32-bit CSA.Loggers TE 1.7.8221.0
CSA.Network.DLL 32-bit CSA.Network TE 1.7.8221.0
CSA.Network.DLL 32-bit CSA.Network TE 1.7.8221.0
Enterprise.Data.DLL 32-bit Enterprise.Data TE 2.35.3.0
Enterprise.Data.DLL 32-bit Enterprise.Data TE 2.35.3.0
Enterprise.Diagnostics.DLL 32-bit Enterprise.Diagnostics TE 2.35.3.0
Enterprise.Diagnostics.DLL 32-bit Enterprise.Diagnostics TE 2.35.3.0
(More Microsoft DLLs... some 32-bit, some 64-bit??)
FederatedLibrary.DLL 32-bit FederatedLibrary Microsoft 1.0.0.0
FederatedLibrary.DLL 32-bit FederatedLibrary Microsoft 1.0.0.0
gdi32.dll 64-bit GDI Client DLL Microsoft Corporation 5.2.3790.4396
gzip.dll 64-bit GZIP Compressn DLL Microsoft Corporation 6.0.3790.1830
Microsoft.Practices.EnterpriseLibrary.Common.DLL 32-bit Enterprise Library Shared Library Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Common.DLL 32-bit Enterprise Library Shared Library Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.DLL 32-bit Enterprise Library Exception Handling Application Block Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.DLL 32-bit Enterprise Library Exception Handling Application Block Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Logging.DLL 32-bit Enterprise Library Logging Application Block Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Logging.DLL 32-bit Enterprise Library Logging Application Block Microsoft Corporation 4.1.0.0
(And finally, the Oracle drivers that seem to be causing issue... 64-bit)
oracle.dataaccess.dll 64-bit Oracle.DataAccess.dll Oracle Corporation 2.112.1.0
oracle.dataaccess.dll 64-bit Oracle.DataAccess.dll Oracle Corporation 2.112.1.0
我使用 corflags
来查看工作的生产 DLL 是否是针对 32 位显式编译的...如果我理解输出,则它们不是。
C:\SingleSignOn\bin>corflags CSA.Network.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 1
ILONLY : 1
32BIT : 0
Signed : 0
理解为什么我们新编译的部署不起作用的第一步是理解为什么当前的部署起作用。谁能向我解释我所看到的?
我需要知道的是:
- IIS 是否作为 64 位进程运行,它是否会加载
任何 CPU
DLL 作为 64 位? - 如果是,为什么 Process Explorer 将这些 DLL 列为 32 位映像?
- IIS 是否可以将 32 位 DLL 加载到 64 位进程空间中?
- 如果 IIS 是 64 位进程,并且我们加载编译为
Any CPU
的网站,如果它依赖的任何 DLL 都是 32 位 DLL(例如,它被编译为 32 位),它会强制使用 32 位吗?针对 32 位版本的 Oracle 驱动程序?)
提前致谢...
Trying to pin down an issue that is most likely due to our web application trying to load a 32-bit version of OracleAccess.dll when IIS is running as 64-bit (it looks like both 32-bit and 64-bit versions of the Oracle drivers may be installed side-by-side).
I have two sites on the server, one for production, and one for test. The production one has code that was deployed by an employee who is no longer with us. That site works. The other site we've just deployed; it was compiled for Any CPU
, and we get errors loading the Oracle drivers.
If I view the IIS worker process for the production site in SysInternal's process explorer, highlight the IIS worker process, and view the loaded DLLs in the lower pane view, I see some strange data.
Info for the worker process:
Process Version User Name PID Image Type
w3wp.exe 6.0.3790.3959 NT AUTHORITY\NETWORK SERVICE 3320 64-bit
But in the list of DLLs that are loaded, some are listed as 64-bit images, and some are listed as 32-bit? It's not possible (AFAIK) to load 32-bit DLLs into a 64-bit process space, so maybe I'm not understanding the report I'm seeing.
Subset of the DLL Handle info:
Name Image Type Description Company Name Version
aspnet_filter.dll 64-bit Microsoft ASP.NET ISAPI Filter DLL Microsoft Corporation 4.0.30319.1
admwprox.dll 64-bit IIS Admin Com API Proxy dll Microsoft Corporation 6.0.3790.3959
adsldp.dll 64-bit ADs LDAP Provider DLL Microsoft Corporation 5.2.3790.3959
adsldpc.dll 64-bit ADs LDAP Provider C DLL Microsoft Corporation 5.2.3790.3959
advapi32.dll 64-bit Advanced Windows 32 Base API Microsoft Corporation 5.2.3790.4555
aspnet_filter.dll 64-bit Microsoft ASP.NET ISAPI Filter DLL Microsoft Corporation 4.0.30319.1
aspnet_isapi.dll 64-bit Microsoft ASP.NET ISAPI Shim DLL Microsoft Corporation 2.0.50727.3053
comctl32.dll 64-bit Common Controls Library Microsoft Corporation 5.82.3790.4770
comctl32.dll 64-bit User Experience Controls Library Microsoft Corporation 6.0.3790.4770
comres.dll 64-bit COM+ Resources Microsoft Corporation 2001.12.4720.3959
(Next few are our DLLs)
CSA.Database.DLL 32-bit CSA.Database TE 1.7.8221.0
CSA.Database.DLL 32-bit CSA.Database TE 1.7.8221.0
CSA.Loggers.DLL 32-bit CSA.Loggers TE 1.7.8221.0
CSA.Loggers.DLL 32-bit CSA.Loggers TE 1.7.8221.0
CSA.Network.DLL 32-bit CSA.Network TE 1.7.8221.0
CSA.Network.DLL 32-bit CSA.Network TE 1.7.8221.0
Enterprise.Data.DLL 32-bit Enterprise.Data TE 2.35.3.0
Enterprise.Data.DLL 32-bit Enterprise.Data TE 2.35.3.0
Enterprise.Diagnostics.DLL 32-bit Enterprise.Diagnostics TE 2.35.3.0
Enterprise.Diagnostics.DLL 32-bit Enterprise.Diagnostics TE 2.35.3.0
(More Microsoft DLLs... some 32-bit, some 64-bit??)
FederatedLibrary.DLL 32-bit FederatedLibrary Microsoft 1.0.0.0
FederatedLibrary.DLL 32-bit FederatedLibrary Microsoft 1.0.0.0
gdi32.dll 64-bit GDI Client DLL Microsoft Corporation 5.2.3790.4396
gzip.dll 64-bit GZIP Compressn DLL Microsoft Corporation 6.0.3790.1830
Microsoft.Practices.EnterpriseLibrary.Common.DLL 32-bit Enterprise Library Shared Library Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Common.DLL 32-bit Enterprise Library Shared Library Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.DLL 32-bit Enterprise Library Exception Handling Application Block Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.DLL 32-bit Enterprise Library Exception Handling Application Block Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Logging.DLL 32-bit Enterprise Library Logging Application Block Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Logging.DLL 32-bit Enterprise Library Logging Application Block Microsoft Corporation 4.1.0.0
(And finally, the Oracle drivers that seem to be causing issue... 64-bit)
oracle.dataaccess.dll 64-bit Oracle.DataAccess.dll Oracle Corporation 2.112.1.0
oracle.dataaccess.dll 64-bit Oracle.DataAccess.dll Oracle Corporation 2.112.1.0
I've used corflags
to see if the working, production DLLs were compiled explicitly for 32-bit... If I understand the output, they're not.
C:\SingleSignOn\bin>corflags CSA.Network.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 1
ILONLY : 1
32BIT : 0
Signed : 0
The first step in understanding why our newly-compiled deployment doesn't work is to understand why the current one does. Can anyone explain to me what I'm seeing?
What I need to know:
- Is IIS running as a 64-bit process, and will it load
Any CPU
DLLs as 64-bit? - If yes, why are those DLLs listed by Process Explorer as 32-bit images?
- Is it possible for IIS to be loading 32-bit DLLs into a 64-bit process space?
- If IIS is a 64-bit process, and we load a website compiled as
Any CPU
, will it force 32-bit if any of the DLLs it depends on are 32-bit DLLs (e.g. it was compiled against a 32-bit version of the Oracle drivers?)
Thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Process Explorer 只是将 AnyCPU DLL 报告为 32 位。 PE 标头中包含此信息的插槽没有 AnyCPU 设置,因此编译器将它们标记为 32 位。但请放心,64 位进程只会加载 64 位 DLL,或强制进入 64 位模式的 AnyCPU DLL。
本机 DLL、comctl32、gdi32 被标记为 64 位,这证明您的进程和其中的所有代码都以 64 位运行。只是 AnyCPU DLL 具有误导性。
Process Explorer is just reporting the AnyCPU DLLs as 32 bit. There slot in the PE header that contains this information doesn't have a setting for AnyCPU so the compiler marks them as 32 bit. But rest assured that a 64 bit process will only load 64 bit DLLs, or AnyCPU DLLs which it forces into 64 bit mode.
The native DLLs, comctl32, gdi32 are marked as 64 bit and that's proof that your process and all the code within is running as 64 bit. It's just the AnyCPU DLLs that are misleading.
在您的应用程序池中,将启用 32 位应用程序设置为 true 以强制您的应用程序为 32 位。
如果应用程序池设置为 32 位模式,您的应用程序的 dll 可以标记为任何 CPU,并且将被加载到 32 位进程中。
对于 IIS 6.0,您可能需要按照此处的说明进行操作 http:// Extended64.com/blogs/rhoffman/archive/2005/05/10/482.aspx
cscript %SystemDrive%\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32bitAppOnWin64 1
根据安装的 Oracle 驱动程序,您也许能够强制加载正确的驱动程序。 IE
In your Application pool set Enable 32-Bit Applications to true to force your application to 32bit.
The dlls of you application can be marked as Any CPU and will be loaded into a 32bit process if the application pool is set to 32bit mode.
For IIS 6.0 you may need to follow the directions here http://extended64.com/blogs/rhoffman/archive/2005/05/10/482.aspx
cscript %SystemDrive%\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32bitAppOnWin64 1
Depending on the Oracle drivers installed you may be able to force the correct one to load. i.e.