任务计划程序未在事件查看器中将失败记录到操作视图中

任务计划程序未在事件查看器中将失败记录到操作视图中

下面的任务调度程序明显有错误,但它从未在任务调度程序操作视图下显示为失败但已成功完成。我想向自己发送有关失败的任务调度程序的电子邮件。我可以在我的旧机器上执行此操作,而不是此 Windows 2012 R2 Server 机器。

应用程序:Tournaments.NotificationProcessor.exe 框架版本:v4.0.30319 描述:由于未处理的异常,该进程终止。异常信息:System.NullReferenceException 堆栈:在 System.Data.Entity.Core.Common.Internal.Materialization.Coordinator1[[System.__Canon,mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]].ReadNextElement(System.Data.Entity.Core.Common.Internal.Materialization.Shaper) 在 System.Data.Entity.Core.Common.Internal.Materialization.Shaper1+SimpleEnumerator[[System.__Canon,mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]].MoveNext() 在 System.Linq.Enumerable.FirstOrDefault[System.__Canon,mscorlib,Version=4.0.0.0,Culture=neutral, PublicKeyToken=b77a5c561934e089] 在 Tournaments.Data.Repositories.Games.GamesRepository.GetGame(Int32, System.Nullable1) 在 Tournaments.NotificationProcessor.Program.Main(System.String[])

答案1

任务运行失败和任务本身在任务中出现错误是有区别的。任务调度程序只是运行任务,它不会监控任务中的错误,只有在它能够正确运行并关闭任务时才会监控。因此,您在应用程序中收到的错误Tournaments.NotificationProcessor.exe必须在该应用程序本身内通知您……任务调度程序不知道发生了这些错误。

相关内容