title: Windows UWP Windows.Devices.SerialCommunication.SerialDevice Not working
body: <p>Is it just me, or is this a bug?</p>
  
  <pre><code>serialPort = await SerialDevice.FromIdAsync(Id);
  </code></pre>
  
  <p><code>serialPort</code> is always null, even while <code>Id</code> is not.</p>
  
  <p>I need to have this working. For now I am just writing very "quick and dirty" code to test serial communication from a Windows 10 Universal app. I debugged in both x86 and x64 with same result.</p>
  
  <p>Here is where I am at for now, but I can't go very far without a serialPort being created....</p>
  
  <pre><code>public class SerialComm
      {
          private SerialDevice serialPort;
          DataWriter dataWriteObject = null;
          DataReader dataReaderObject = null;
  
          public async void StartTest()
          {
  
              var deviceSelector = SerialDevice.GetDeviceSelector("COM3");
              var myDevices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(deviceSelector);
              var myCurrentDevice = myDevices[0];
              string Id = myCurrentDevice.Id.ToString();
  
              try
              {
                  serialPort = await SerialDevice.FromIdAsync(Id);
              }
              catch (Exception)
              {
  
                  throw;
              }
  
              StringBuilder commandBuilder = new StringBuilder();
  
              while (true)
              {
                  var rBuffer = (new byte[1]).AsBuffer();
                  await serialPort.InputStream.ReadAsync(rBuffer, 1, InputStreamOptions.Partial);
  
                  if ((char)rBuffer.ToArray()[0] != '\n')
                  {
                      commandBuilder.Append((char)rBuffer.ToArray()[0]);
                  }
                  else
                  {
                      string temp = "";
  
                      try
                      {
                          temp += rBuffer.ToString();
                      }
                      catch (Exception)
                      {
                          temp = "Error";
                      }
  
                      commandBuilder.Append(temp);
                  }
  
                  string stringToDisplay = commandBuilder.ToString();
              }
  </code></pre>
  
  <p>Thanks for your help and advices....</p>