websss
asked on
multiple versions of exe running - how to manage it so only 1 is running?
I have a console app, which isn't closing properly....i.e.
After closing the console application, the window disappears, but the process is remaining in the task manger
I believe the active X control is responsible, however, I need a way to get rid of it in task manger
When i reopen it/close i end up with multiple versions running in task manger and its causing issues
I would like to add code a line of code which can "kill" the previous running process for the same console application.
I have tried these two cases
Case 1:
Case 2 :
This code is for closing apps that have the name "FlirAdapterConsole"
I have tried using these names instead
FlirAdapterConsole.exe
FlirAdapterConsole.exe *32
but the apps do not close
any help appreciated!
After closing the console application, the window disappears, but the process is remaining in the task manger
I believe the active X control is responsible, however, I need a way to get rid of it in task manger
When i reopen it/close i end up with multiple versions running in task manger and its causing issues
I would like to add code a line of code which can "kill" the previous running process for the same console application.
I have tried these two cases
Case 1:
AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
static void CurrentDomain_ProcessExit(object sender, EventArgs e)
{
foreach (var process in Process.GetProcessesByName("FlirAdapterConsole"))
{
process.Kill();
}
}
When I close the console app, this isn't getting called so this doesn't workCase 2 :
[STAThread]
static void Main()
{
foreach (var process in Process.GetProcessesByName("FlirAdapterConsole"))
{
process.Kill();
}
This is supposed to kill any previous instances of the app running in task manager, but instead it actually closes the current appThis code is for closing apps that have the name "FlirAdapterConsole"
foreach (var process in Process.GetProcessesByName("FlirAdapterConsole"))
{
process.Kill();
}
I have tried using these names instead
FlirAdapterConsole.exe
FlirAdapterConsole.exe *32
but the apps do not close
any help appreciated!
Have you tried killing the active x instead? What activex is it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.