简体   繁体   中英

C# app that does not access sql server db when run with windows task scheduler

I work on an application coded in c# (.net framework 4) and that accesses a database and reads/writes some tables.

When I run the app on the development machine it runs ok (tables are well written). When I run the app on windows server 2003 outside task scheduler, it runs ok (tables are well written). When I run the app on from windows task scheduler, it does not run ok (tables are not written at all).

I tried many accounts, and event the administrator one, to launch the task in task scheduler, but any account does not work.

I must write that an older version of the application runs ok on development machine, on windows server 2003 with/without windows task scheduler (tables are well written).

Any idea ?

Thanks

The only thing I would recommend is to add lines:

Debugger.Break();
Debugger.Launch();

right where actual connection has to be opened and debug the application. With this amount of information there's nothing else to advise.

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