4

首先,我之前设法让我的一个 64 位测试 Web 应用程序在这台机器上运行(回到我为这个项目设计原型的时候)。我已经在 32 位上工作了几个星期,并意识到我需要将应用程序切换到 64 位,当我这样做(在项目中将目标平台设置为 x64)并重新部署时,它停止运行。

上次我花了几天的时间才让 64 位工作,我不确定这次我错过了什么,我上次做了什么。

我在 IIS 下发布和调试。

我收到带有以下消息的 BadImageFormatException:“无法加载文件或程序集 'GEMS.Web' 或其依赖项之一。尝试加载格式不正确的程序。”

此应用程序引用 64 位和 32 位程序集。我已在 IIS 的应用程序池中将“启用 32 位应用程序”设置为 true。

我正在使用 VS.NET 2012、IIS 7.5,在 64 位 Win 7 机器上运行。

以下来自程序集负载跟踪:

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Windows\SysWOW64\inetsrv\w3wp.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = XXXXXX\xxxxxx
LOG: DisplayName = GEMS.Web
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: GEMS.Web | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///c:/inetpub/wwwroot/GEMS.Web/
LOG: Initial PrivatePath = c:\inetpub\wwwroot\GEMS.Web\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\inetpub\wwwroot\GEMS.Web\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/gems.web/eea5792e/72317e39/GEMS.Web.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/gems.web/eea5792e/72317e39/GEMS.Web/GEMS.Web.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/GEMS.Web/bin/GEMS.Web.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
4

2 回答 2

6

使用以下方法更改您的 IIS 以处理 64 位处理:工具 | 选项 | 项目和解决方案 | 网站项目 | 使用 64 位版本的 IIS Express

于 2015-06-15T18:33:51.557 回答
3

如果您不使用任何本机 Win32 库,则应Any CPU针对您的程序集,不要弄乱 IIS 中的启用 32 位应用程序设置(将其设置为 false)。

于 2012-12-07T15:40:11.583 回答