我使用的是第三方应用程序,它在代码中使用DLLImport。他们正在使用的COM DLl,他们分别给了我。
我确实把文件放在第三方源代码的Bin/Debug文件夹中,并重新编译了代码。
这样做之后,我发现无法在我的应用程序上加载模块错误。知道为什么会是这样吗?
它抛出以下错误:
Unable to load DLL 'QMSL_MSVC10D.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}我确实在其中运行了依赖步行器,并看到了以下错误:
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.我的问题是,他们怎么能用这么多错误编译DLL呢?我所看到的错误和我们在依赖者中所看到的有什么关联呢?
发布于 2014-01-30 21:16:55
除了“未找到DLL”外,该错误消息还可能意味着未找到DLL的依赖项之一,DLL或其依赖项之一具有与主机应用程序不同的体系结构,或者初始化函数DllMain返回了失败代码。
使用进程监视器监视文件活动,并检查打开DLL文件是否失败(这可能是DllImport中列出的文件,但也可能是依赖项)
基于DLL的文件名,听起来好像它是针对C++库的调试版本构建的。不允许分发运行时库的Debug版本;您的源需要为您提供一个针对运行时库的发布版本构建的DLL (可以在它们的DLL中启用调试,但它们不能使用调试运行时)。
发布于 2014-01-30 21:16:47
如果这是COM DLL,则需要将其注册为"regsvr32 name.dll“。在命令提示符中键入它,然后按“Enter”。将"name.dll“替换为您拥有的dll。
如果DLL必须是GAC而不是bin文件夹的一部分,也可能发生此错误。
发布于 2015-07-18 18:45:03
只有当您在public class中使用它时,以及在使用以下namespaces时,该namespaces才能工作
using System;
using System.Runtime;
using System.Runtime.InteropServices;
https://stackoverflow.com/questions/21467454
复制相似问题