I have an application that imports data from Excel. However, when I run the winforms app and I intrupt the application, using System.Windows.Forms.Application.Exit(); I can still see the “MyAppName”.vshost32.exe running in task manager.
When I exit the application in debug mode, the form closes, but the VS IDE is not “stopped”.
How do I ensure the application ends correctly.
The process doesn’t terminate because it still has foreground threads running.
If you create threads in your application you need to mark them as background threads or make sure they terminate when you want the application to exit.