我试图使用libusb将一些C源代码(Linux)移植到C# (Windows)。我成功地在Windows7上安装了LibUsbDotNet,然后继续添加using MonoLibUsb,因为它看起来是移植的最简单的途径。但是,在运行时,有一个例外说libusb-1.0.dll丢失了。事实上,我似乎无法在C:\Windows\System32中找到它。所以,有两个问题
发布于 2015-10-23 10:50:56
在你发表文章一年后,在使用C#库编译一个LibUsbDotNet程序时,遇到了同样的问题:
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: 2https://stackoverflow.com/questions/25301703
复制相似问题