## SerialPort background thread exceptions ### Scope Minor ### Version Introduced 4.7.1 ### Source Analyzer Status NotPlanned ### Change Description Background threads created with streams no longer terminate the process when OS exceptions are thrown.
In applications that target the .NET Framework 4.7 and earlier versions, a process is terminated when an operating system exception is thrown on a background thread created with a stream.
In applications that target the .NET Framework 4.7.1 or a later version, background threads wait for OS events related to the active serial port and could crash in some cases, such as sudden removal of the serial port. - [X] Quirked - [ ] Build-time break ### Recommended Action For apps that target the .NET Framework 4.7.1, you can opt out of the exception handling if it is not desirable by adding the following to the `` section of your `app.config` file: ```xml ``` For apps that target earlier versions of the .NET Framework but run on the .NET Framework 4.7.1 or later, you can opt in to the exception handling by adding the following to the `` section of your `app.config` file: ```xml ``` ### Affected APIs * `T:System.IO.Ports.SerialPort` ### Category Core