Asp.net running principle, notes in notes
When you request a URL containing an ASP. NET application, IIS receives the request (IIS is a WEB service waiting process). After IIS receives the request
Request Host Header, IP address, or port number to find the corresponding site.
IIS
After the site is found, if the requested resource is a WEBFORM ending with ASPX, IIS will give control to an ISAPI extension.
AspNet_ISAIP.DLL. At this time, the control is transferred by IIS to the ISAPI extension of ASPNET.
ISAPI
Applications that can process various extensions, usually called ISAPI applications (NOTE:Internet Server Application Programe Interface, Internet Server Application Interface ). Although this ISAPI sounds very elegant, it is also an "application", but you can see it by looking at its full name:It is actually only an interface that acts as a proxy. Its main task is to map the requested page (File) and the actual processing program corresponding to the suffix.
After receiving the Processing request, ISAPI starts an ASP. NET workflow and transfers the requester's request information to the ASP. NET workflow (named
ASPNET_WP.EXE). Next, the control is controlled by ASPNET_WP.
ASPNET_WP.EXE, APPDOMAIN
ASPNET_WP first solves the information of the requester. If the ASP. NET application requested by the requester (site or virtual directory, generally speaking, does not have
APPDOMAIN, ASPNET_WP will create an APPDOMAIN, and the Assembly required for the requested ASP. NET application (that is, those DLL, such
System. Web. DLL and so on) are loaded into the APPDOMAIN.
After the APPDOMAIN Initialization is complete, you need to establish a session. Therefore, the request is accepted by HttpRuntime.
This is to create an HttpContext object for each requesting customer. This stuff manages the HttpSession object. Every visitor
Each has its own HttpContext object and HttpSession object.
HttpRuntime is responsible for creating HttpContext and HttpSession, and httpContext is responsible for managing httpSession
Until the httpContext is created in HttpRuntime, your application is still not running, or the requester's request is not actually
The previous work is both preparation and auxiliary work. In addition to creating the above objects, HttpRuntime also needs to be created.
HttpApplication. The process of creating an Application object is complicated.
Next, HttpApplication calls the ProcessRequest method to process user requests. This method calls the corresponding HttpHandler to process user requests. HttpHandler processes requests based on the file extension of the user request and returns the request results, that is, HTML is sent to the client browser.