I have an win-form c# that opens a console application. When i launch the form, which automaticly launches it opens a process
conhost.exe
I tried everything to be able to auto close it, but no solution so far. Any ideas?
this and similar code i tried:
foreach (Process proc in Process.GetProcessesByName("conhost.exe"))
{
    proc.Kill();
}
I got to this question by a different route - working on a C# console app that was leaving conhost.exe/vhost.exe running after it should have exited.
Adding an Environment.Exit(0) at the end of processing fixed that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With