.Net 应用程序正常运行,按计划中断
我有一个非常简单的.Net应用程序,它每天都会创建文件夹,通常我手动运行它,并且已经完成了将近一年,昨天我决定安排它以节省时间,当我遇到我们一直遇到的问题时我们的项目已经有很长一段时间了。
当计划时间到达时,应用程序运行,但崩溃,在任务计划程序界面上只留下“指定的查询不正确”。然后我手动运行该exe,它再次工作,所以接下来我尝试通过任务计划程序手动运行它,它再次崩溃。
我正在以最高权限运行计划任务,它在我们网络上的服务器上运行,我正在检查连接是否可用等。我有域管理员,但我一生都看不到导致这种情况发生的原因。
任何帮助都会很棒!
I have a very simple .Net application which creates folders on a daily basis, usually I run it manually and have done for almost a year, yesterday I decided to schedule it to save time, when I ran into a problem we have been encountering for a long time now on our projects.
When the scheduled time arrives the application runs, but crashes, leaving only "the Specified Query is incorrect" on the Task Scheduler interface. I then run the exe manually and it works again, so next I try to run it manually through the Task Scheduler and it crashes once more.
I am running the scheduled task with highest privaledges and it operates on a server on our network, I am checking the connection is available etc. I have domain admin and cannot see for the life of me what is causing this to happen.
Any help would be great!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要记录错误并进行诊断。基本上,当您安排应用程序时,请确保没有 UI 弹出等,因此您需要传递参数以使其静默运行。您可能需要更改代码并重试。另外,确保您已添加有时在参数情况下需要的必要的“”引号,并指定正确的启动目录等。
You need to log the error and do a diagnostics.Basically when you schedule an application make sure that no UI pops up etc so you need to pass arguments to make it run silently.You may need to change the code and try again.Also make sure you have added the necessary "" quotes that are needed sometimes in case of arguments and also specify the correct start up directory etc.
它在哪个帐户上运行? NETWORK_SERVICE 将是一个好主意。
异常详细信息也会有所帮助。
Which account do it run on? NETWORK_SERVICE would be a good idea.
Exception details would also help.