UWP C# app cannot open driver for device connected via USB

ぐ巨炮叔叔 提交于 2020-06-16 21:37:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!