简体   繁体   English

是什么导致“任务计划程序”挂起我的应用程序

[英]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. 如果我运行.exe文件,它将运行正常,但是,如果我将.exe作为任务在“任务计划程序”中运行,则当程序尝试连接到数据库时,我的程序将挂起。 This is the line that hangs. 这是挂起的线。 在此处输入图片说明

this is a normal DbConnection implementation. 这是正常的DbConnection实现。 IDbConnection.Open(). 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 在基于Windows Server 2003的系统上,计划任务似乎挂在“正在运行”状态

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. 我必须以最高权限运行任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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