在 IIS7.5 的 64 位 Windows 上运行 x86 Asp.net 应用程序时出现问题

Ger*_*nck 3 asp.net 64-bit iis-7.5 windows-server-2008-r2

我目前正在准备一台新服务器来运行我们的 ASP.Net 平台。我第一次在 64 位 Windows (2008 R2) 上进行安装,并使用 IIS7.5(之前一直是 7.0)。我们的网站是用 x86 构建的,因此我已启用应用程序池以使用 32 位应用程序。

我在浏览网站时遇到以下错误:

Server Error in '/' Application.



The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:



[FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)]

   System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0

   System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43

   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127

   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142

   System.Reflection.Assembly.Load(String assemblyString) +28

   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46



[ConfigurationErrorsException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)]

   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613

   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203

   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105

   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178

   System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54

   System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +600

   System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125

   System.Web.Compilation.BuildManager.EnsureFirstTimeDirectoryInit(VirtualPath virtualDir) +8803959

   System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode) +219

   System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath) +43

   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +59

   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101

   System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +126

   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +62

   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33

   System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) +37

   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +307

   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Run Code Online (Sandbox Code Playgroud)

我使用 fuslogvw 来追踪任何 .Net 绑定错误:显示了 4 个程序集,但当我第一次浏览该网站时,我在常规服务器上得到了相同的 4 个程序集。这些程序集是 CppCodeProvider、VJSharpCodeProvider 和我们的两个 *.resources 文件。我已经研究过这些,我不认为它们是这个问题的原因,当然不是在发现工作环境在fuslogvw中具有相同的缺失程序集之后。

接下来我使用 Dependency Walker 研究网站的主 DLL。似乎没有丢失任何内容,但我收到以下消息:

* Error: Modules with different CPU types were found.
Run Code Online (Sandbox Code Playgroud)

我认为这不是一个问题,因为我的 .Net 程序集是 x86,而所有其他依赖项都是 x64。

所以我真的很想知道 ASP.Net 抱怨缺少什么“模块”。

Jef*_*ian 6

我通过在应用程序池的高级设置选项卡下将启用 32 位程序设置为True解决了该问题。

启用 32 位程序
(来源:紫竹jy.com

这篇博文中有详细信息