form app runs in background after closing c# code example Example: prevent C# app from lingering after closing in background processes Process.GetCurrentProcess().Kill();