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.