In my console application I have code which looks like
Process DKU = new Process();
DKU.StartInfo.FileName = "MSSQLExecutor.exe";
DKU.Start();
DKU.WaitForExit();
Console.WriteLine("lets move on ");
This is working fine and it waits until MSSQLExecutor.exe finishes its job, then after that the app continues.
My problem is that sometimes MSSQLExecutor.exe crashes and Windows by default shows a dialog for ending the program. At that point my application will wait forever for the user to click the Close button.
I want to avoid this because MY application is going to run as a service without user interaction.