任务计划程序不会在事件查看器中将故障logging到操作视图

下面的任务调度程序明显错误,但在任务调度程序操作视图下从不显示为失败,但已成功完成。 我想发送一个失败的任务调度器的电子邮件给我自己。 我可以在我的旧盒子上做这个,而不是这个Windows 2012 R2服务器盒子。

应用程序:Tournaments.NotificationProcessor.exe Framework版本:v4.0.30319说明:由于未处理的exception,进程已终止。 exception信息: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 =在System.Linq.Enumerable.FirstOrDefault [System .__ Canon,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089]上的MoveNext()在Tournaments.Data.Repositories.Games.GamesRepository .GetGame(Int32,System.Nullable1)在Tournaments.NotificationProcessor.Program.Main(System.String [])

无法运行的任务和任务本身在任务中有错误是有区别的。 任务调度程序只是运行任务,它不监视任务内的错误,只要它能够运行并正确地closures任务。 因此,您在Tournaments.NotificationProcessor.exe应用程序中收到的错误必须在该应用程序本身内通知您…任务计划程序将不知道发生了这些错误。