The taskbar icon for my app becomes orphaned

Under the following circumstances the taskbar icon for my app becomes orphaned. In other words, my app is no longer running but the taskbar icon is still visible until I hover my mouse pointer over it which causes it to disappear.

1) If my app crashes
2) If I press the Stop button in the Visual Studio Debugger

Questions:
1) Is there a way to make sure the taskbar icon gets removed if scenario #1 above takes place?
2) Is there a way to make sure the taskbar icon gets removed if scenario #2 above takes place?

Thank you!
Was this page helpful?