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

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

问题描述

我一直在追踪这个过去一周的例外。



情况是:



应用程序是用C#编写的并在Visual Studio 2010中构建的。
应用程序包括一个DLL,它是非托管代码库的包装器。
非托管代码用C ++编写并在Visual Studio 2008中构建。这是必需的,因为代码引用了附加库(Qt),并且该代码的目标是WinCE版本5(由于字段中支持的设备的需要)。 p>

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



所有的工具都没有问题(反射器)或旧的依赖关系,在我的环境(Win 7),如DCOMP.DLL,GPSVC过时。 DLL,& IESHIMS.DLL。



在调试器中,我可以直接遍历我的代码,直到我实例化一个引用我的托管包装器DLL的对象。



在进程管理器中(从SysInternals),我可以看到托管的DLL加载,以及必需的辅助DLL。在进程监视器(从SysInternals)在问题的点,没有没有堆栈的未找到的消息。

解决方案



解决问题的任何想法或想法。 / div>

@ 汉斯·帕萨特 - 感谢您对全球旗帜的提示。



这里是一篇关于使用工具。大多数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导入的过程”的源无法加载。例外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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