I deployed my solution for Azure CloudService using the SDK version 2.6. The solution works fine, and now I want to configure some IIS settings from RoleEntryPoint (for example, to keep Threadpool working continuously).
Whatever I do, it seems like my RoleEntryPoint is never called. I try to track information, I throw exceptions, I even return false in OnStart (). I am deploying my package, the Cloudservice instances restart and everything is fine.
This is my simple class:
using System;
using System.Diagnostics;
using System.Linq;
using Elmah;
using Microsoft.Web.Administration;
using Microsoft.WindowsAzure.Diagnostics;
using Microsoft.WindowsAzure.ServiceRuntime;
using Telerik.Sitefinity.Cloud.WindowsAzure;
namespace SitefinityWebApp
{
public class AzureWebRole : RoleEntryPoint
{
public override void Run()
{
Trace.WriteLine("Entering Run method");
Trace.TraceInformation("Run");
base.Run();
}
public override bool OnStart()
{
return false;
Trace.WriteLine("Entering OnStart method");
Trace.TraceInformation("OnStart");
throw new System.ApplicationException("you are going down!");
return base.OnStart();
}
}
}
This class is in my main WebRole-Assembly. After deployment, I tried "Reimaging" and restarted the virtual machine. Both should be unnecessary, but I wanted to make sure that the role gets the opportunity to call RoleEntryPoint.
, ? , "" OnStart , ? ?