0

我有 ac# 程序在从 VS 调试/运行时运行良好。当它在任务调度程序上运行时,它会在我的代码中的某个点停止,然后运行并运行。我可以根据我的日志看到这一点。

这是我的代码:

static class Program
{
    static void Main()
    {
        try
        {
            Log.WriteLog("Email Sync invoking...");

            // task scheduler stops here
            foreach (EmailAccount account in EmailAccount.Get())
            {
                Log.WriteLog("Syncing email account " + account.Username);
                EmailAccount.Sync(12, account.Username);
            }

            Log.WriteLog("Email Sync completed.");
        }
        catch (Exception ex)
        {
            Log.WriteError(ex);
        }
    }
}

任何想法为什么会发生这种情况?

4

0 回答 0