Worker Role in Azure working?

I have an application that sends automatic mails via a worker role. When I debug my application in Visual Studio my task that I set OnStart() in the WorkerRole.cs works perfectly, I receive a mail every 5 minutes (for test purposes). My Code in WorkerRole.cs:

   public override bool OnStart()

        ScheduledTaskTimer.Elapsed += new ElapsedEventHandler(ScheduledTaskTimer_Elapsed);
        // ScheduledTaskTimer.Interval = 86400000;
        ScheduledTaskTimer.Interval = 180000;

        ScheduledTaskTimer.Enabled = true;
        return base.OnStart(); }

But when I deploy to Windows Azure, my worker role does not seem to work. I never receive any mail.. I don't know how to check if the worker role is actually running..


Please Study my comments in the question below:

Webrole is not starting and always busy

For a worker role you dont need to follow step 2) above if you don't have a web server running, still you can all other steps to troubleshoot this issue.

You can view the state of your worker role using the silverlight interface provided by Microsoft at:

If you see that your WorkerRole is never in the "Ready" state, it often means that your WorkerRole can't start. Which means an exception is probably thrown in the OnStart() method.

If you want to understand what is going on you can:

  1. configure event logs recording
  2. configure Remote Desktop Protocol to access the server
  3. Put a try catch around all the code in the OnStart method and record the exception in a database. You can easily do this using ELMAH

Need Your Help

Sorting strings with UILocalizedIndexedCollation and localizedStandardCompare: method

ios sorting core-data localized

Is there any differences in the sorting order when using this (for in-memory sorting)

Best git mysql versioning system?

mysql database git version-control merge

I've started using git with a small dev team of people who come and go on different projects; it was working well enough until we started working with Wordpress. Because Wordpress stores a lot of