Debugging an app launched through scheduled tasks

痴心易碎 提交于 2019-12-11 02:32:04

问题


How do I debug an application which is launched via scheduled tasks?

I have a simple application which works fine when double clicked to launch, but it doesn't work when launched through scheduled tasks.

I know how to debug projects on a local computer, but this application has no issues running on a local computer or on a different computer if launched manually by the user by double clicking the executable file.

I need a way to debug the application when it's being launched by scheduled tasks. Is this possible?


回答1:


I would primarily suggest putting in some decent logging so that you can diagnose problems without resorting to the debugger. However, to launch the debugger, you can either attach it to an existing process in Visual Studio (using Debug/Attach to process... menu), or change the code to include the Debugger.Launch() method which will launch the debugger and attach it to the process. Of course all of this is dependent on your program actually being executed by the scheduler. If the scheduler doesn't execute the program, then the debugger obviously can't attach to it



来源:https://stackoverflow.com/questions/20679726/debugging-an-app-launched-through-scheduled-tasks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!