问题
I am trying to read data from a device that is connected via USB. My app is UWP C#. manufacturer of device supplied a .NET dll file. I can successfully open the driver, get driver config and read data with a C# console application (console application works without any problems). However, same code does not work in UWP app. my code compiles and i am able to load dll. The code does nothing when device API's are called in UWP app.
i was thinking it may have something to do with specifying device capabilities in Package.appx.manifest file, therefore, i added following: All examples i have seen online are for using windows APIs to interact with custom devices. However, i am using .dll file.
<Capabilities>
<Capability Name="internetClient" />
<uap:Capability Name="removableStorage"/>
<iot:Capability Name="lowLevelDevices"/>
<DeviceCapability Name="usb">
<Device Id="vidpid:1878 1321">
<Function Type="name:vendorSpecific"/>
</Device>
</DeviceCapability>
I am not an expert in UWP or devices. Really looking for guidance on how to make my C# code + dll that works in C# console app to work in UWP App. Thank you in advance.
来源:https://stackoverflow.com/questions/62311275/uwp-c-sharp-app-cannot-open-driver-for-device-connected-via-usb