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

问题描述

我们已经编写了一项服务,该服务使用计时器控件每隔60秒检查一个进程

。这是安装在带有SP1的Windows 2003 Server上的。


我们遇到的问题是服务没有停止,但它是

似乎计时器进程停止了。有没有其他人遇到这个?

是什么解决方案?

We have written a service that uses a timer control to check for a process
every 60 seconds. This is installed on a Windows 2003 Server w/SP1.

The problem we are running into is that the service doesn''t stop, but it
seems the timer process stops. Has anyone else run into this? What have
been solutions?

推荐答案




你使用什么Timer类?您应该使用System.Timers.Timer和

确保AutoReset设置为true


-

Ignacio Machin,

ignacio.machin AT dot.state.fl.us

佛罗里达州交通局



What Timer class r u using? You should be using System.Timers.Timer and
make sure that the AutoReset is set to true

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation




Timer类使用什么?你应该使用System.Timers.Timer和
确保AutoReset设置为true

- Ignacio Machin,
ignacio.machin AT dot。 state.fl.us
佛罗里达州交通局



What Timer class r u using? You should be using System.Timers.Timer and
make sure that the AutoReset is set to true

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation






服务是做什么的?

它是在第一次或几次事件之后发生的吗?

您是否正在处理所有例外情况?使用AppDomain.UnHandledException


我有一个类似的环境,我还没有遇到任何问题,计时器

(和一个filesystemwatcher)按预期工作所有的时间。



-

Ignacio Machin,

ignacio.machin at dot.state.fl .us

佛罗里达州交通局



What the service does?
Does it happen the first time or after several events?
Are you handling all the exceptions ? using AppDomain.UnHandledException

I have a similar environment and I haven''t had any problem yet, the timer
(and a filesystemwatcher) works as expected all the time.


--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


这篇关于定时器服务问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 18:24