how to stop from app from running in background when closed c# visual studio code example
Example: prevent C# app from lingering after closing in background processes
Process.GetCurrentProcess().Kill();
Process.GetCurrentProcess().Kill();