Windows服务无法自动启动 [英] windows service not starting automatically

查看:209
本文介绍了Windows服务无法自动启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我尝试了几种方法来完成这项工作,但只找到了解决方法。所以我发布这是最后一次试用。


我有一个Windows服务,必须启动并生成一个文件,并在每个星期一和星期五通过电子邮件发送给我们的客户。


服务仅在我停止并启动它时执行此操作。但是如果没有人启动它就必须这样做。我知道我们使用计时器。我也是。但我不知道这个问题是什么。计时器应该每天开始并检查它是星期一还是星期五它没有做。


以下是我的代码



Hi,

I have tried several ways to make this work but only found work arounds. so I am posting this as a last trial.

I have a windows service which has to kick start and generate a file and email it to our clients every monday and friday.

the service does this only when i stop it and start it. but it has to do this without someone starting it. i know we use a timer for this. i did too. but i dont know whats the issue. the timer is supposed to start everyday and check if its a monday or friday which it is not doing.

below is my code



展开 | 选择 | Wrap | 行号

推荐答案

您的帖子中是否涉及到问题?或者你认为我们是心灵读者? 嗯...我只看到云......哦,好吧......


史蒂文
Is there a question involved in your post? Or do you think we''re mindreaders? "Hmmmm...I just see clouds...Oh, well..."

Steven


是的,有一个问题参与这个职位。该服务未手动运行。每次必须生成该文件时我都要启动它。
Yes there is a question involved in the post. the service is not running manually. I have to start it every time it has to generate that file.


你是否尝试过在每个函数中将日志条目放入程序(就像测试一样),看它是否有最终处于糟糕的状态?

(即关闭,或计时器停止或其他)
Have you tried putting log entries into the program (just as a test) at every function and such, to see if its ending up in a bad state?
(i.e. closed, or the timer is stopped or whatever)


这篇关于Windows服务无法自动启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆