问题
CustomSerialDeviceAccess is a sample on Microsoft's GitHub and it's for UWP to read/write SerialPort.
The problem is that the sample can open devices on Win10 but get "DeniedByUser" on Windows Server 2019 & Windows Server 2016. I try to find some different things about Registry and Group Policy but get nothing. Can you give me some suggestions? Thx!
回答1:
I got the way to fix the problem.
Use MDM/GP to set the trusted devices policy to ForceAllow. For GP example, gpedit.msc -> Administrative templates -> Windows components -> AppPrivacy -> Trusted Devices.
来源:https://stackoverflow.com/questions/54397934/cant-find-seiralport-device-by-using-serialdevice-fromidasync-and-got-imforma