I have created application using C#. and I want my application should always run even the user closed that application or bcoz of some exceptions or any other things terminate my application, it should be restarted automatically. I am planning to run my application in windows services.
also thinking abt batch files. but not sure. any one have solution for my problem??

Nilanka DharmadasaRank #1,875 · 794 reputationPosted Jan 10, 2010, 6:47 PM EST
Us this line, when you want to restart your application.
System.Windows.Forms.Application.Restart();
If you find any problem let me know.
If this helps, please tick 'Do you like this answer' checkbox.
Mann D4 reputationPosted Jan 10, 2010, 7:51 PM EST
That Helps...but when i use TASK MANAGER to terminate the application..it closed that application...:(
And my requirement is whatever happens My Application exe should be always run.... even if the user terminates it from task manager or due to some operating sys error.....
have any solution????
naura paxRank #2,843 · 502 reputationPosted Jan 11, 2010, 12:02 AM EST
you said "That Helps...but when i use TASK MANAGER to terminate the application..it closed that application...:(
And my requirement is whatever happens My Application exe should be always run.... even if the user terminates it from task manager or due to some operating sys error..... "
This can be a dangerous thing to do, your application might cause your system to hang, apart from that user might not be able to even force shutdown the machine when needed.
Kirtan PatelRank #292 · 8.6K reputationPosted Jan 11, 2010, 2:09 AM EST