简体   繁体   中英

Task scheduler stops running C# console application periodically

I have a task scheduler which runs a C# console application every minute. It runs the .application file via a .bat file and does so successfully for a period of time before stopping completely.

Un-installing/re-installing my console application doesn't fix the problem and the task scheduler is showing the batch file as succesfully executing. Also, running the program manually works just fine.

My questions are:

  1. How can I get this task to run again via the task scheduler. I have tried deleting and re-creating the task, uninstalling/reinstalling the applcation.

  2. I have a scheduled backup task occuring around the time the application stops working. Volume shadow copy is not enabled. Could this be impacting my application and why?

In the task scheduler take a look at the Settings tab. You will find an option "If the task fails, restart every".

By default (this is not checked) then if your task fails it will not be run again. You can check your task history to see if it has failed. In any case it sounds like you want to be run again even if it failed the last time it ran.

This is the option you want to change.

Despite the help, I did not manage to isolate the cause of this problem.

I have re-developed my scheduler using Quartz.NET and it's now running as a Windows service.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM