如何查找“xxx.dll”导入的“A过程的源”无法加载。“例外? [英] How do I find the source of a "A procedure imported by 'xxx.dll' could not be loaded." exception?

查看:281
本文介绍了如何查找“xxx.dll”导入的“A过程的源”无法加载。“例外?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在追赶这个例外。



情况是:



我有一个使用C#编写并构建在Visual Studio 2010中的应用程序。
应用程序包含一个作为非托管代码库的包装器的DLL。
非托管代码用C ++编写,内置于Visual Studio 2008中。这是必需的,因为代码引用了其他库(Qt),并且该代码指向了WinCE版本5(由于该字段支持的设备是必需的)。 p>

我已经尝试了许多我在这里看到的建议,包括使用各种依赖性步态(VS 2008 depends,dependency_walker和Dependz)以及其他工具,如反射器和过程从SysInternals监视。



所有这些工具都不会显示在我的环境(Win 7)中已经过时的问题(反射器)或旧的依赖项,如DCOMP.DLL,GPSVC。 DLL,& IESHIMS.DLL。



在调试器中,我可以直接跳过我的代码,直到我实例化引用我的Managed Wrapper DLL的对象。它不会进入对象的实例化,而是立即抛出异常。



在Process Explorer(来自SysInternals)中,我可以看到被加载的托管DLL,以及必要的辅助DLL。在进程监视器(来自SysInternals)的问题点上没有堆栈的未找到的消息。



发现此问题的任何想法或想法将不胜感激。

解决方案

@ Hans Passat - 感谢您提供全球标志。



这里是一个很好的博客文章使用工具。大多数Google引用显示加载程序堆栈引用的gflags.exe程序是Windows设备驱动程序开发工具包(WinDDK)的一部分,它会为您管理该文章中提到的注册表设置。



使用显示加载器堆栈运行的输出确定了应该在我的非托管DLL中的符号不​​在我使用的DLL中。



事实证明,我正在构建错误的DLL版本。这是由于我对构建过程的了解不佳(太多版本建立了太多不同的方式)。


I have been chasing this exception for the past week.

Situation is:

I have an application that is written in C# and built in Visual Studio 2010. The application includes a DLL that is a wrapper of an unmanaged code library. The unmanaged code is written in C++ and built in Visual Studio 2008. This is required because the code references additional libraries (Qt) and that code targets WinCE version 5 (necessary due to devices supported in the field).

I have tried many of the suggestions I have seen here, including using various dependency walkers (VS 2008 depends, dependency_walker, and Dependz) as well as other tools such as Reflector and Process Monitor from SysInternals.

All of the tools either show no problems (Reflector) or old dependencies that are obsolete in my environment (Win 7) like DCOMP.DLL, GPSVC.DLL, & IESHIMS.DLL.

In the debugger, I can step through my code right up until I instantiate an object that references my Managed Wrapper DLL. It does not step into the instantiation of the object, but throws the exception immediately.

In Process Explorer (from SysInternals) I can see the Managed DLL loaded, along with the necessary subsidiary DLLs. In Process Monitor (from SysInternals) at the point of the problem there are no stacks of not found messages. It just fails.

Any ideas or thoughts in finding this problem would be appreciated.

解决方案

@ Hans Passat - Thank you for the hint on Global Flags.

Here is an excellent blog post on using the tools. The gflags.exe program referred to by most of the Google references to "Show Loader Stacks" is part of the Windows Device Driver Development Kit (WinDDK) and it manages the Registry settings mentioned in that post for you.

The output from running with "Show Loader Stacks" identified that a symbol that should have been in my unmanaged DLL was not in the DLL I was using.

It turns out that I was building the wrong version of the DLL. This was due to my poor understanding of the build process (too many versions built too many different ways).

这篇关于如何查找“xxx.dll”导入的“A过程的源”无法加载。“例外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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