Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Guest
2018-05-15T16:59:04Z
Hi, there,

I have a C# console app. At the end of the program, I print out "task has ended normally", and then do an Environtment.Exit(0).

But Visual Cron still show it is running long (hours) after even though the log line "task has ended normally" is printed. i can run this app from cmd.exe, it is returns a zero exit code in a few minutes (the normal running time).

static void Main(string[] args)
{
ScenarioPricer myScenarioPricer = new ScenarioPricer();
try
{
myScenarioPricer.Run(args);
log.Info("Scenario Pricing exiting normally.");
Environment.Exit(0); // force exit code of 0. Visual Cron will fail a job even though job finished normally
}
catch( Exception ex )
{
log.Error("Scenario Pricing Failed.", ex);
Environment.Exit(-1);
}
}

Please help!
Sponsor
Forum information
Guest
2018-05-15T18:38:25Z
Here is the log file. Showing the program only took 3.5 mins to run. But the this task in Visual Cron showed "Running" state for hours, until I killed it manually. I am not sure why Visual Cron didn’t see 1) the task finished and 2) exited with return code 0.
2018-05-15 09:06:03,521 [1] INFO ScenarioPricer.ScenarioPricer::Run - Starting Scenario Pricing....
2018-05-15 09:06:03,568 [1] INFO Util.DateUtil::LoadHolidays - Loading Holidays....
2018-05-15 09:09:32,295 [1] INFO ScenarioPricer.ScenarioPricer::Run - Pricing Finished successfully.
2018-05-15 09:09:32,295 [1] INFO ScenarioPricer.ScenarioPricer::Main - Scenario Pricing exiting normally.
Support
2018-05-16T06:28:23Z
Without having the code I would remove the Environment.Exit(0). It should exit normally when that code part is finished. No need to force. Please try this.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top