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

时间:2009-11-05 10:20:30

标签: 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

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

接下来,我使用Dependency Walker来研究网站的主要DLL。似乎没有什么遗漏,但我得到以下信息:

* Error: Modules with different CPU types were found.

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

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

4 个答案:

答案 0 :(得分:4)

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

答案 1 :(得分:3)

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

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

Details in this blog post

答案 2 :(得分:2)

最近我在R2上安装了4.0 beta 1应用程序时遇到了类似的问题,结果相似。我花了很长时间才发现问题是项目中引用的核心.net程序集之一(来自GAC)已被标记为CopyLocal为true。我不知道怎么做 - 我当然没有刻意去做,也没有其他人在那个上做过。一旦我将其设置回来(并且,我认为我必须删除本地副本)一切都很顺利。

答案 3 :(得分:0)

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

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