Roman Borovets
Roman Borovets

Reputation: 858

ASP.NET Core app started by Windows Task Scheduler

I've created some simple ASP.NET Core app based on .Net Framework 4.6.2. It has a public endpoint which receives and returns file. This app should run continuously on a virtual machine and when I'm starting it manually (exe) it works perfectly.

When it's started by Windows Task Scheduler, I'm able to make a call but in response, I'm getting the file with 0 size - that means that something crashed inside.

What can be the difference between starting app manually and by task scheduler (which I think is causing the crash) and how can I check logs or output of app which is started by Task Scheduler?

Upvotes: 0

Views: 466

Answers (2)

Roman Borovets
Roman Borovets

Reputation: 858

The problem actually was in the way how the Task Scheduler run the app. If the app is started by Task Scheduler - it's running like a Windows Service, and root directory for it is C:\Windows\System32\Tasks and I was not able to get my static resources.

Upvotes: 0

Sylence
Sylence

Reputation: 3073

Make sure that the correct user is set in the scheduler.

The Windows Event Log should contain information about a crashed app that was launched by the Task Scheduler

Upvotes: 0

Related Questions