Los*_*ost 2 .net c# com dllimport
我正在使用第三方应用程序,该应用程序在其代码中使用 DLLImport。他们正在使用的COM DLl,他们单独给了我。
我确实将该文件放在第三方源代码的Bin/Debug文件夹中并重新编译了代码。
执行此操作后,我在应用程序上看到无法加载模块错误。有什么想法为什么会出现这种情况吗?
它抛出以下错误:
Unable to load DLL 'QMSL_MSVC10D.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}
Run Code Online (Sandbox Code Playgroud)
我确实在其中运行了 dependency walker,并且看到以下错误:
Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Run Code Online (Sandbox Code Playgroud)
我的问题是,他们如何编译出现这么多错误的 DLL?我看到的错误与我们在 Dependency walker 中看到的错误之间存在任何关联的可能性有多大?
除了“找不到 DLL”之外,该错误消息还可能意味着未找到 DLL 的依赖项之一、DLL 或其依赖项之一的体系结构与主机应用程序不同,或者初始化函数DllMain
返回了失败代码。
使用进程监视器监视文件活动,并检查打开 DLL 文件是否失败(可能是 DllImport 中列出的文件,但也可能是依赖项)
根据 DLL 的文件名,听起来好像它是针对 C++ 库的调试版本构建的。不允许分发 Debug 版本的运行库;您的源代码需要为您提供一个针对运行时库的发布版本构建的 DLL(可以在其 DLL 内启用调试,但不能使用调试运行时)。