0

We have developed an ASP.NET website on a Windows 7 - 32 bit platform using Visual Studio 2008. This website is being hosted at a hosting company where we share a server with hundreds of other ASP.NET websites.

We are in the process of changing our hosting to a dedicated Windows 2008 - 64 bit server.

We have installed Visual Studio on this new server in order to debug our application.

If we try to start the application on this new server using Visual Studios 2008's own web server (not IIS 7) we get the error below.

We have tried to compile the application in both 32 as well as 64 bit mode. We also tried to compile to "Any CPU". But nothing helps. We also tried running Visual Studio as an administrator but without success.

We get the following error:

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.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +232
   System.Web.Compilation.BuildManager.CompileGlobalAsax() +51
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337

[HttpException (0x80004005): The specified module could not be found. (Exception from HRESULT: 0x8007007E)]
   System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729

[HttpException (0x80004005): The specified module could not be found. (Exception from HRESULT: 0x8007007E)]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8897659
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259

Does anyone know why this error appears and how to solve it?

4

3 回答 3

2

首先,您得到的错误与丢失的文件有关,因此FileNotFoundException. 但是,您也会得到HRESULT 0x8007007E,它指向缺少的非托管 DLL。

以下是我将如何解决这个问题:

  1. 单步执行代码以查找此异常发生的位置。有了这个HRESULT,我很确定你会发现异常出现在调用非托管 DLL 函数的行上。
  2. 确定您尝试使用的非托管 DLL。
  3. 检查它是否在那里。首先,您应该检查您正在使用的任何一个都在正确的位置并且被正确引用。如果一切正常,请确保他们自己拥有的任何依赖项也都存在。

此外,在您完成第 2 步后,如果您告诉我们您正在使用哪种类型的非托管代码(即,就其自身的依赖关系而言,运行它可能需要什么),我们可能会为您提供更多帮助。

希望我有所帮助!:)

于 2010-05-22T18:24:45.160 回答
1

该错误与特定于处理器的内容无关。显然是一个丢失的文件导致了这个错误。您是否仔细检查过是否在新的专用服务器上安装了所有必需的文件和程序集?

于 2010-05-22T17:52:06.097 回答
0

是否有任何错误信息表明找不到哪个模块?

如果没有,请验证部署的 bin 目录是否包含您的站点在测试服务器上运行时的所有内容。然后通过 web.config 并确保所有引用的模块都在目标服务器上。

于 2010-05-22T17:55:55.353 回答