I am working with an C# console application in which I am creating process and when I killing that process it shows that process got killed but process does not get stopped and also application does not exit.
process.StartInfo.WorkingDirectory = @"C:\Users\rajgau\Documents\logstash-2.1.1\bin";
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardOutput = true;
process.Start();
process.StandardInput.WriteLine("logstash -f logstash-filename1.conf");
Thread.Sleep(1000 * 10); // atleast some data get loaded
process.StandardInput.Close();
Console.WriteLine("{0} is active: {1}", process.Id, !process.HasExited);
process.Kill();
Console.WriteLine("{0} is active: {1}", process.Id, !process.HasExited);
Also For exiting the console application I tried Environment.Exit(0) but even it did not help.Kindly suggest some points.