System.Timers.Timer Exception Number must be either non-negative or -1. Parametername: dutTime

  • Thread starter Thread starter shajeel
  • Start date Start date
S

shajeel

i got this exception while calling Timer.Start()

Number must be either non-negative or -1.
Parameter name: dueTime

can any one tell me the reason.
timer interval is set to 180000. and after restarting application it is
not occuring.

Regards
Shajeel
 
shajeel said:
i got this exception while calling Timer.Start()

Number must be either non-negative or -1.
Parameter name: dueTime
can any one tell me the reason.

Timer.Start() does not take any parameters. And "dueTime" is not a Timer
property, either. So clearly you are not telling the whole story of how this
timer gets initialized. Post your code or nobody can help . . .

-rick-
 
sorry for being late, didnt know how to set options so that i can get
mail if someone replies.

as for code, it is a bit long but it is something like this.

try
{
this.timer1.Stop();
......
log.WriteLine("Ending current session, restarting in three
minutes");
this.timer1.Start();
}
catch(Exception e)
{
log.WriteLine(e.Message);
}

i am doing this in timer.Elapsed event. and in my log file i got these
two entries

Ending current session, restarting in three minutes
Number must be either non-negative or -1.
Parameter name: dueTime
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top