I have a very simple console exe application. This application will be executed by Windows Server R2 Task Scheduler after every 15 minutes. This was working fine for a long period of time but since last 2 days the application is not exiting some times. The problem is that Task Scheduler will never run the application again unless the previous started application exit. Here is my application code,
static void Main(string[] args)
{
MyService.Process();
}
internal static void Process()
{
try
{
Logger.Log("Starting Service");
// Synchronous Work
Logger.Log("Ending Service");
}
catch (Exception ex)
{
Logger.Log("Unknown error occured: " + ex.Message);
}
}
When I check the log file I am seeing these lines at the end of file,
Starting Service
--------------------------
Ending Service
The Task Scheduler in Windows Server 2008 R2 showing me memory = 480), CPU = 0 and Threads = 1. What can be the possible cause that forbid the exe to exit. Also, note that it only happens some times. My application creates, moves, delete some files/directories using File and Directory class and send some data to server using WebClient.UploadValues