【问题标题】:Knowing the reason of DLL loading failed for Windows Store App了解 Windows Store App 加载 DLL 失败的原因
【发布时间】:2012-10-01 14:59:54
【问题描述】:

我尝试在 Windows 8 应用商店应用程序中使用 EmguCV 库。以前,它适用于 Windows 7 桌面应用项目。

我确保我的 Windows 8 应用商店应用项目目录 [C:\Projects\App2\App2\bin\Debug] 包含所有必要的 DLL 文件。

当我通过 Local Machine 按钮直接在 Microsoft Visual Studio 2012 Ultimate 中执行时,出现以下异常。

异常:抛出:“无法加载 DLL 'opencv_core240':指定的 找不到模块。 (来自 HRESULT 的异常:0x8007007E)” (System.DllNotFoundException) System.DllNotFoundException 是 抛出:“无法加载 DLL 'opencv_core240':指定的模块 找不到。 (来自 HRESULT 的异常:0x8007007E)”

我的问题是:如何知道故障是否是由于我的 Windows 8 应用商店应用无法找到 DLL 文件?或者,找到的 DLL 文件不是 Windows 8 应用商店应用所期望的格式? (这些 DLL 适用于 Windows 7 桌面软件)

如果原因是由于Windows 8 Store App无法识别格式引起的,请重新编译整个DLL项目(OpenCV源代码是C++,EmguCV作为包装器是C#)下Windows 应用商店 -> 类库(Windows 应用商店应用程序) 会有帮助吗?

【问题讨论】:

  • 您的应用程序可能能够加载 opencv_core240.dll,但该 DLL 又依赖于其他一些 DLL(如 VC++ 运行时 DLL),因此它甚至无法加载 OpenCV DLL .更多信息在这篇文章:stackoverflow.com/questions/12894063/…

标签: windows-8 microsoft-metro


【解决方案1】:

如果这些 dll 适用于 Windows 7 桌面应用程序,那么它们将不适用于 Windows 8 Metro 应用程序,因为它是完全不同的平台和 API。您不能在 Windows 8 WinRT 项目中只加载任何 dll。

如果您有 dll 的源代码,您可以尝试将其重新编译为 Windows 运行时组件,但很有可能原始代码使用了 WinRT 中不可用的 API。

【讨论】:

    【解决方案2】:

    查看以下两篇文章,了解如何使 OpenCV 或其他 3rd 方库与 Windows 8 应用商店应用程序一起使用:

    Using OpenCV in a Windows Store app with Visual C++

    Using a C++ Library (built using Visual C++ 2010) in a Windows 8 Store app (built using Visual C++ 2012)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-10
      • 1970-01-01
      • 1970-01-01
      • 2016-06-09
      • 1970-01-01
      • 2020-06-02
      • 1970-01-01
      相关资源
      最近更新 更多