I have written a simple .NET Core console app (which writes some log files, hits a database and sends some emails). Triggering the task by double-clicking on the .exe within Windows works fine.
However when attempting to trigger the task through Task Scheduler it immediately fails with the code 0xC0000005
. This failure happens when actually triggered on it's schedule or by right-clicking the task within the Task Scheduler app and clicking 'Run'. The first thing the app attempts to do is write something to a log file, which never happens.
The same server has a bunch of other .NET console apps (not .NET core) that are configured with exactly the same permissions and user accounts and they work fine.
In the event log there's a record that reads:
Faulting application name: StorePlay.ClientEmailer.exe, version:
1.1.0.1179, time stamp: 0x58224b03 Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000 Exception code: 0xc0000005
Fault offset: 0x00007ffaef1d8955 Faulting process id: 0xe0c Faulting
application start time: 0x01d301e534cdde90 Faulting application path:
C:\storePlay\Tasks\Client Emailer\StorePlay.ClientEmailer.exe Faulting
module path: unknown Report Id: 1bc8be44-744c-452e-a945-997d64d1d87b
Faulting package full name: Faulting package-relative application ID:
This is all on a machine running Windows Server 2016