What causes 'Task Scheduler' to hang my application
<p>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.
<a href="https://i.stack.imgur.com/qhuh8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qhuh8.png" alt="enter image description here"></a></p>

<p>this is a normal DbConnection implementation. 
IDbConnection.Open().</p>

<p>What could cause this?</p>