c# - 错误 : Unable to load DLL '.dll' : The specified module could not be found.(HRESULT : 0x8007007E) - What is this error? 异常

标签 c# .net reference error-handling

情况:

我正在尝试运行 CharLS JPEG-LS Compression algorithm implementation

网站中有源代码,您可以在其中下载 C# VS 2010 解决方案。解决方案中有 2 个 C# 类库项目、1 个非托管 VC++ 项目和 1 个 C# 控制台应用程序。控制台应用程序调用类库之一“using CharLS;”,并且该特定库引用非托管 VC++ 项目。控制台应用程序在 Debug模式下完美运行。

问题:

但是当我编译“Release”控制台应用程序并运行.exe(可执行文件)时,当在此过程中调用特定函数时,它会给出以下错误:

Error: Unable to load DLL 'CharLS.dll' : The specified module could not be found. (Exception from HRESULT: 0x8007007E)

我还尝试创建另一个项目并从那里引用类库,但我得到了同样的错误。

我尝试在网上阅读其他解决方案,但它们没有帮助我。

最佳答案

导致此错误的部分原因可能是:

  1. 您为“DllImport”属性的“EntryPoint”属性提供的名称与您从 native 组件导出的函数不匹配。

  2. 另一个原因可能是缺少 dll 本身/或其任何依赖项(使用依赖项遍历器并检查)

  3. 第三个原因可能是调试/发布版本不匹配。

关于c# - 错误 : Unable to load DLL '.dll' : The specified module could not be found.(HRESULT : 0x8007007E) - What is this error? 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12899293/

相关文章:

c# - 从 Linq byte[] Concat 转换为旧的 .net Array 并考虑复制和长度

c# - 为什么 ^*$ 匹配 "127.0.0.1"

c# - Visual Studio 2022 关闭自动缩进

c# - Web API 代表 adal id_token 错误

.net - channel 工厂类-WCF

c# - 从 DataTable 填充 WinForms TreeView

class - ASP.NET - 如何引用不在 app_code 中的类

perl - 将标量和散列传递给 Perl 中的子程序

asp.net - Crystal Report 引擎运行时错误

c# - dotnet run --https 的项目问题