简体   繁体   中英

What causes 'Task Scheduler' to hang my application

I have a console application that connects to a remote database. It runs fine if I run the .exe file, However If I run the .exe as a task in 'Task Scheduler', my program hangs when it tries to connect to the database. This is the line that hangs. 在此处输入图片说明

this is a normal DbConnection implementation. IDbConnection.Open().

What could cause this?

Please have a look at below links:

How to find out the reason why a scheduled task hang?

Scheduled Tasks appear hung in the “Running” state on Windows Server 2003 based systems

It will help you to identify what causes 'Task schedule' to hang your application and also to troubleshoot your issue.

The issue was Administrator privilege. I had to run the task with the highest privileges.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM