The Microsoft SerialCommuncation docs site describes that System-internal ports are currently not supported:
Microsoft Docs about windows.devices.serialcommunication
I don’t understand why not, and they may add this functionality in the future.
A workaround is:
C#
Use the standard .NET System.IO.Ports.SerialPort class (except GetPortNames()) everything works in .NET for UWP 6.1.5. As replacement for GetPortNames you can P/Interop to GetCommPorts.
C++/winrt
Use the new Windows 10 RS3/4 API call OpenCommPort. See the Windows header files for the function prototype, as this function is currently not documented on MS docs.
Note also ensure that in your .appxmanifest file you app "claims" access to a serial port:
<DeviceCapability Name="serialcommunication">
<Device Id="any">
<Function Type="name:serialPort" />
</Device>
</DeviceCapability>