In most cases, this can be resolved by making the thread a background thread through it’s IsBackground property.
By default, managed threads are created as foreground threads, while unmanaged threads are created as background threads. When all of the foreground threads in an application have terminated, the CLR invokes Abort on the background threads that are still running.
Share with