How is the Azure web role performed without an entry point?

Out of curiosity, I opened my Azure web role project, went to the file containing the descendant RoleEntryPoint class, and completely removed this class definition. Then I packed this role and deployed it to Azure - the role started without any error messages.

How could this work?

+2
azure azure-web-roles
source share
2 answers

In addition to what DarwkwingDuck said, I just mentioned that RoleEntryPoint Provides methods to run the code when the role instance is initialized, started and stopped.

If we continue to read the RoleEntryPoint class document on MSDN , we will also see the following:

Worker roles must extend the RoleEntryPoint class to add functionality to role instances. Web roles can optionally extend the RoleEntryPoint Class or can use ASP.NET lifecycle management methods to process start and end sequences. For the Windows virtual machine role, Services is used instead of the RoleEntryPoint class.

So Web Roles can further extend the RoleEntryPoint class .

+4
source share

RoleEntryPoint exists in your deployment whether you inherit it or not. Note that all methods that you have in this class override the implementation of the base class. These base class implementations will run instead if you do not inherit RoleEntryPoint.

It also makes it easy to port older applications to Azure - just add your existing web application to the cloud project as a role and walk away.

+3
source share

All Articles