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

发布于 2024-08-09 21:07:00 字数 4924 浏览 9 评论 0原文

我目前正在准备一台新服务器来运行我们的 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

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

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

* Error: Modules with different CPU types were found.

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

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

I'm currently in the process of preparing a new server to run our ASP.Net platform on. For the first time I'm doing the installation on a 64-bit Windows (2008 R2), and with IIS7.5 (before that always 7.0). Our website is built in x86, so I've enabled the application pools to use 32-bit applications.

I'm stuck at the following error which I get when I browse the website:

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

I've used fuslogvw to track down any .Net binding errors: 4 assemblies showed up, but I get the same 4 on our regular server when browsing the site for the first time. The assemblies are CppCodeProvider, VJSharpCodeProvider and two of our *.resources files. I've looked into these, and I don't think they are the cause of this problem, certainly not after finding out a working environment has the same missing assemblies in fuslogvw.

Next up I used Dependency Walker to study the website's main DLL. Nothing seems to be missing, but I get the following message:

* Error: Modules with different CPU types were found.

I don't think this is an issue also because my .Net assembly is x86 and all the other dependencies are x64.

So I really want to know what missing "module" ASP.Net is complaining about.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

撩动你心 2024-08-16 21:07:00

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

启用 32位程序
(来源:zizhujy.com

此博文中有详细信息

I solved the problem by setting Enable 32 bit program to True under advanced setting tab of App Pool.

Enable 32 bit program
(source: zizhujy.com)

Details in this blog post

妳是的陽光 2024-08-16 21:07:00

这解决了我的问题:我必须将 msvcr71.dll 放在 c:\windows\system32 和 c:\windows\syswow64 中。

This solved my problem: I had to place the msvcr71.dll in c:\windows\system32 and c:\windows\syswow64.

软的没边 2024-08-16 21:07:00

我最近在 R2 上放置 4.0 beta 1 应用程序时遇到了类似的问题,得到了类似的结果。我花了很长时间才发现问题是项目中引用的核心 .net 程序集之一(来自 GAC)已被标记为 CopyLocal true。我不知道是怎么做到的——我当然不是故意这样做的,也没有其他人参与过这一工作。一旦我将其恢复(并且,我认为我必须删除本地副本),一切都很好。

I had a similar problem recently when putting a 4.0 beta 1 app on R2, with similar results. It took me quite a while to discover that the problem was that one of the core .net assemblies referenced in the project (from the GAC) had become marked as CopyLocal true. I've no idea how - I certainly didn't do it deliberately and no-one else worked on that one. Once I set that back (and, I think I had to delete the local copy) all was well.

謌踐踏愛綪 2024-08-16 21:07:00

我在这里找到了 CppCodeProvider 问题的答案:
http://www.experts-exchange。 com/Programming/Languages/.NET/.NET_Framework_2.0/Q_24367712.html
(需要登录)

关闭“定义 TRACE 常量”,或者在有问题的计算机上安装 .NET SDK。

I found the answer for my problem with CppCodeProvider here:
http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_2.0/Q_24367712.html
(login is required)

Turn off "Define TRACE Constant" or else install the .NET SDK on the computer with the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文