c# - LibUsbDotNet,没有 libusb-1.0.dll

标签 c# windows libusb-1.0 libusbdotnet

我正在尝试使用 libusb 将一些 C 源代码 (Linux) 移植到 C# (Windows)。我在 Windows 7 上成功安装了 LibUsbDotNet。然后我继续使用 MonoLibUsb 添加,因为它看起来是最简单的移植路径。但是,运行时出现异常,提示缺少libusb-1.0.dll。事实上,我似乎无法在 C:\Windows\System32 中找到它。那么,有两个问题

  1. 在哪里可以找到它?网上搜索没有找到任何方便的安装程序包。
  2. 为什么它没有作为 LibUsbDotNet 的一部分安装? AFAICS 的缺失导致 LibUsbDotNet 的一半无法使用。

最佳答案

在您发表文章一年后,在使用 LibUsbDotNet 库编译 C# 程序时偶然发现了同样的问题:

PS C:\src\FaultMonitor\FaultMonitor\bin\Debug> .\FaultMonitor.exe -u
An error occured while executing the proxy:
libusb-1.0.dll not found. If this is a 64bit operating system, ensure that the 6
4bit version of libusb-1.0.dll exists in the '\Windows\System32' directory.
at MonoLibUsb.MonoUsbSessionHandle..ctor()

对于任何处于类似困境的人,请下载libusb库并提取内容(您将需要 7zip )。在提取的内容中,将 \MS32\dll\libusb-1.0.dll 复制到 C:\windows\SysWOW64\ 文件夹中,然后复制 \MS64\dll\libusb-1.0.dll 到您的 C:\windows\System32\ 中。之后程序运行没有问题:

PS C:\src\FaultMonitor\FaultMonitor\bin\Debug> .\FaultMonitor.exe -u
[15-10-23.02:09:05][+] Device: VendorID: 4203, ProductID: 63, Address: 1
[15-10-23.02:09:05][+] Device: VendorID: -32530, ProductID: 33, Address: 2

关于c# - LibUsbDotNet,没有 libusb-1.0.dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25301703/

相关文章:

c# - 如何在循环中获取多个文本框的值

c# - DataGridCell 中的 WPF 转换器

c# - ReSharper 包装测试结果堆栈跟踪?

python - 在 Python 中安装包时 pip install tr​​aceback 错误

android - libusb_open 返回 LIBUSB_ERROR_ACCESS?

c# - 如何使用 C# 调用 REST API?

python - 启动器中的 fatal error : Unable to create process using '"' in python

C++ USB 与 USB 复合设备 (usbccgp.sys) 通信

linux - 在 Nsight Eclipse 中链接 libusb-1.0 库?

windows - 批处理文件以递归方式删除文件夹中超过 N 天的文件