Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When there's no class extending <code>RoleEntryPoint</code> the web role <a href="https://stackoverflow.com/q/9173101/57428">will run just fine</a>, just no extra code is run instead of <code>OnStart()</code>, <code>Run()</code> and <code>OnStop()</code>.</p> <p><code>Application_Start()</code> is completely unrelated to Azure and is completely ignored by Azure runtime, it's just some piece of ASP.NET wiring. You can easily have <code>Application_Start()</code> unconditionally throwing an exception and that won't prevent your web role from getting started, just all HTTP requests will fail.</p> <p>Bear in mind that starting with SDK 1.3 the default mode is "IIS mode" where the web role payload containing <code>RoleEntryPoint</code> descendant runs in one process (WaIISHost.exe) and ASP.NET code runs in another process. The process with <code>RoleEntryPoint</code> is started by Azure runtime first, it runs <code>OnStart()</code> and enters the infinite loop in <code>Run()</code>, then the instance is opened for HTTP requests. If you use IIS 7.5 and have "autostart" enabled you may have <code>Application_Start()</code> executed earlier, but otherwise you won't have <code>Application_Start()</code> executed until the first request comes.</p> <p>So the key is that there're two different processes running your code and each has its own lifetime and that dictates limitations on how you can design your application.</p> <p>The <code>RoleEntryPoint</code> descendant class can have any name, belong to any namespace and be located in any .cs file within the project which is selected as the payload for the web role - that will likely be your ASP.NET project. Under these conditions the <code>RoleEntryPoint</code> descendant will be located by Azure runtime and its methods will be run as part of role instance lifetime.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload