代码之家  ›  专栏  ›  技术社区  ›  Gerrie Schenck

在使用iis7.5的64位Windows上运行x86 ASP.NET应用程序时出现问题

  •  2
  • Gerrie Schenck  · 技术社区  · 15 年前

    我目前正在准备一个新的服务器来运行我们的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中有相同的丢失组件之后。

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

    * Error: Modules with different CPU types were found.
    

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

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

    4 回复  |  直到 10 年前
        1
  •  4
  •   Gerrie Schenck    15 年前

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

        2
  •  3
  •   Jeff Tian    10 年前

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

    Enable 32 bit program http://zizhujy.com/blog/image.axd?picture=Enable32Bit.png

    Details in this blog post

        3
  •  2
  •   serialhobbyist    15 年前

    最近我在r2上安装了一个4.0测试版1应用程序时遇到了类似的问题,结果也差不多。我花了很长时间才发现问题在于项目中引用的一个核心.NET程序集(来自GAC)已标记为CopyLocal true。我不知道怎么做-我当然不是故意这样做的,也没有其他人去做。一旦我把它放回去(而且,我想我必须删除本地副本),一切都很好。

        4
  •  0
  •   Jakob Christensen    11 年前

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

    关闭“define trace constant”,否则将.NET SDK安装到有问题的计算机上。