B
Ben Gavin
Hi all,
I have some simple windows service code which fires a timer event every
minute. The code seems to function normally in the Release build of the
client, but when running the debug build of the client (to service our
active development effort), the timer seems to stop sending events after a
(seemingly random) amount of time. I've added tracing into the routine and
this proves out the theory that there is not an error going on in the event
handler. The handler looks like:
tmr_Elapsed(...)
{
try
{
tmr.Stop();
... do stuff ...
}
catch(Exception e)
{
.. log error ..
}
finally
{
tmr.Start();
}
}
This works fine, and I see the trace messages indicating that the timer is
being started/stopped normally, but after the service has been running for a
few hours, the timer just quits. As I said, this only seems to happen in
Debug builds, the release builds that I've deployed can run for weeks on end
without an issue, but the debug build can't even make it an entire day
without getting lost.
Has anyone seen this error before, and found a way to solve it?
Thanks!
Ben
I have some simple windows service code which fires a timer event every
minute. The code seems to function normally in the Release build of the
client, but when running the debug build of the client (to service our
active development effort), the timer seems to stop sending events after a
(seemingly random) amount of time. I've added tracing into the routine and
this proves out the theory that there is not an error going on in the event
handler. The handler looks like:
tmr_Elapsed(...)
{
try
{
tmr.Stop();
... do stuff ...
}
catch(Exception e)
{
.. log error ..
}
finally
{
tmr.Start();
}
}
This works fine, and I see the trace messages indicating that the timer is
being started/stopped normally, but after the service has been running for a
few hours, the timer just quits. As I said, this only seems to happen in
Debug builds, the release builds that I've deployed can run for weeks on end
without an issue, but the debug build can't even make it an entire day
without getting lost.
Has anyone seen this error before, and found a way to solve it?
Thanks!
Ben