title: What is the cause of System.IO.IOException on windows XP embedded version?
body: <p>I am running a .Net 3.5 application on Windows XP embadded version. This application writes and reads some data over the serial (COM) port. The application works fine on my laptop (windows XP Professional) but not on windows XP embedded. I keep getting this error:</p>
  
  <blockquote>
    <p>System.IO.IOException: The I/O operation has been aborted because of either a thread exit or an application request.</p>
  </blockquote>
  
  <p>What could be the causing it? </p>
  
  <p>Some additional info: to read, I am using <code>ReadExisting</code> and not <code>Readline</code>. Also before reading I am making sure the port is open too.</p>
  
  <pre><code>System.IO.IOException: The I/O operation has been aborted because of either a thread exit or an application request.
  at System.IO.Ports.SerialStream.EndRead(IAsyncResult asyncResult)
  at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset, Int32 count, Int32 timeout)
  at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset, Int32 count)
  at System.IO.Ports.SerialPort.ReadExisting()
  at ScalesApp.Scales.handleDataReceived(Object sender, SerialDataReceivedEventArgs e)
  at System.IO.Ports.SerialPort.CatchReceivedEvents(Object src, SerialDataReceivedEventArgs e)
  at System.IO.Ports.SerialStream.EventLoopRunner.CallReceiveEvents(Object state)
  at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
  </code></pre>