前置條件: 安裝 libusb mono編譯環境
下載LibUsbDotNet源碼後 :
-
xbuild LibUsbDotNet.sln。
然後你就可以mono xxx.exe 。進行相關開發了
反正很魔幻 在linux上編譯exe 然後在window上配置mono環境 然後就可以兩邊跑exe。
ps: 安裝方法來自LibUsbHelp.chm(libusb安裝包裏面的)
LibUsbDotNet 2.2.8 Getting Started With Linux C#Visual BasicVisual C++ |
LibUsbDotNet is compatible with linux/unix-like operating systems that support mono.net 2.0 and libusb v1.x.
Prerequisites
Note:
The user must have appropriate access permissions to the usb device before it can be used with linux. This is true for most unix-like OSes.
-
If your platform has its own package manager (Aptitude, Synaptic, etc), use it to download and install the required software packages below.
-
Download and install the libusb-1.0 package.
If libusb-1.0 binaries do not exists for your platform, you must build them from source. Building libusb-1.0 from source is very straightforward. See the INSTALL documentation file in the libusb-1.0 source package for more details.
-
Download and install the Mono.Net 2.x package.
The pre-compiled Mono.Net runtime binaries are available for nearly all platforms. However, for information on bulding the mono.net runtime from source see Compiling_Mono.
Using the pre-built LibUsbDotNet Binary package.
-
Download the LibUsbDotNet_Bin package and unzip it to a new sub-directory (LibUsbDotNet_Bin).
-
Open a terminal window and navigate to the new LibUsbDotNet_Bin directory.
-
Run the Test_Info application by typing: mono Test_Info.exe
Test_Info should find all USB devices the user has access to and provides a device count in the status bar. If no devices are found, verify the user has sufficient access permissions, or try running as the root user.
Building LibUsbDotNet From Source
-
Download the LibUsbDotNet_Src package and unzip it to a new sub-directory (LibUsbDotNet_Src).
-
Open a terminal window and navigate to the new LibUsbDotNet_Src directory.
-
The LibUsbDotNet.sln can be built with the xbuild tool:
xbuild LibUsbDotNet.sln