"指定的模块找不到"运行C#ASP.NET Web服务指C当错误++ DLL [英] "The specified module could not be found" error when running C# ASP.NET web service referring C++ dll

查看:254
本文介绍了"指定的模块找不到"运行C#ASP.NET Web服务指C当错误++ DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2005中它是指一个C ++ DLL C#ASP.NET Web服务项目。但是,当我尝试运行Web服务我得到以下错误,是在Web浏览器中显示:

I have C# ASP.NET web service project in visual studio 2005 which refers a C++ dll. But when I try to run the web service I get the following error which is shown in the web browser:

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.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +163
System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +53
System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +175
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +86
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101
System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +83
System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath) +10
System.Web.UI.WebServiceParser.GetCompiledType(String inputFile, HttpContext context) +43
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +180
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +193
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

不过,我是指在同一个DLL在同一个解决方案,Windows窗体应用程序,这是工作的罚款。对于这个Windows应用程序工作,我用的Dependency Walker软件来解决DLL的很少依赖。但我无法弄清楚如何,当我尝试运行Web服务解决此错误。我的操作系统是Windows 7旗舰版64位

However I refer the same dll for windows form application in the same solution and it is working fine. For this windows application to work I used Dependency Walker software to resolve few dependencies of the dll. But I can't figure out how to resolve this error when I try to run the web service. My operating system is Windows 7 Ultimate 64 bit

我可以知道为什么我米收到此错误,以及如何解决这个问题?
谢谢

Can I know why I m getting this error and how to resolve this ? thanks

推荐答案

我的猜测是你的C ++ DLL可能非托管code。

My guess is your C++ dll is likely unmanaged code.

+ DLL你闯民宅,它在32位或64编译的C?

The C++ dll you're refering, it's compiled in 32bit or 64?


  • 的Windows应用程序的工作,因为你
    启动过程。

  • Web应用程序正在运行的内
    Web服务器的应用程序池
    它被设置为在32位运行
    或64。

在IIS管理器中,选择应用程序
  池。在应用列表
  池,选择应用程序池您
  配置为您的Web应用程序。在操作
  窗格中,选择在高级设置
  编辑应用程序池。展开
  常规设置,设置启用32位
  应用为True,然后单击确定。

In IIS Manager, select Application Pools. In the list of Application Pools, select the application pool you have configured for your web app. In the Actions pane, select Advanced Settings under Edit Application Pool. Expand the General settings, set Enable 32-bit Applications to True, and click OK.

这篇关于"指定的模块找不到"运行C#ASP.NET Web服务指C当错误++ DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆