Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
Auto-Start is a new functionality with our web applications in ASP.NET 4 so this whole Auto-Start Web App idea is something that you're probably going to see on the exam in some form. So in this video I want to just introduce to the idea, explain what it is and in then in separate video we'll talk about how to configure this and turn it on. Okay. So first of all, let's think about this concept of an application starting up. When exactly does an ASP.NET application start up if we're not using Auto-Start? Well it starts up when that very first HTTP request is received. So we built our application, we deployed it out to the web server and then when the first HTTP request comes in and the ASP.NET Pipeline starts to work, then a lot of things start to happen and here is exactly what happens when an ASP.NET Application starts up. Again this first request comes in for part of the web app, ASP.NET jumps into play and it starts to compile all the application items, objects, classes that it needs to build those pages. We've talked about that in earlier parts of the course. Some web applications can take even longer to start up besides this basic compilation because they have to load large amounts of data, maybe they're retrieving large amounts of data, preloading pages or putting a lot of data on the home page for clients or customers or see and then they may have to perform other initializations for additional functionality that's going to have to happen in other parts of the application. Bottom line here is it can take quite a few seconds sometimes for an ASP.NET application to start up. Now there's about 3 or 4 billion different things that come into play here and it's all designed around how you actually coded the application, what all's got to happen and you always have that debate amongst developers, is it better to make the end-user wait on the frontend and preload or everything? Or just spread the wait times out, make them shorter but more common throughout the app? Don't want to get into that argument here. But now, if an application has to start that means it also has to stop and if your ASP.NET app stops then you've got through all this compilation process and slow response and all for that first user all over again. So what would make our app stop? Well anytime we make a modification to the Source Code or ASP.NET applications going to stop. Any kind of additions, deletions or changes to things like any of our assemblies in the bin folder, any of our localization resources, any kind of changes to that Global asax file, any kind of configuration changes to the Web.Config file, is going to make this web application stop and need to be restarted. Now also, there's Application Pool Settings out there that could make your web, your ASP.NET application stop. After a specified period of inactivity, the application stops and it hands it's memory back to the web server, because another website might need it. So you can change that period of inactivity and shut down and so forth, but the bottom line is your web app could stop for a lot of different reasons. Now historically, start up actions were taken when that first user request was first received by the web application and users were going to have to just sit and wait because the developer had put a bunch of preliminary start up functions that they just coded right there into the Global asax file on the application start up event and that first user experienced a very slow web experience. Because they made their request, they had to wait for ASP.NET to wake up, compile the objects, do any kind of initializations, on and on and on. So that first user could be pretty painful. Now future requests were not slow. It didn't have to go through all the compilation, all that stuff didn't have to happen. So with Auto-Start Web Apps, what the Auto-Start functionality accomplishes is, everything happens the same that as it did, except for one piece. Alright. Our web app still has to start but the Auto-Start functionality gives us a more controlled process for starting our web application memory pool and initializing or initialing the app, accepting HTTP requests and getting everything going. Okay. It gives us a more orderly control there. The application starts up as normal. It can still be a slow process, however, the start up process occurs automatically whenever IIS or Internet Information Server or Internet Information Services or the application itself is restarted. If we shut the server down, restart it, stop our web application pool, whatever. Anything that stops IIS or application, as soon as it can, when it comes back up, the Auto-Start functionality is going to restart that application. Now here's the big deal. A user request is not allowed until start up is complete. Better to have a user not hit the website than to hit the website and have to wait longer than what they're comfortable with and then lose them that way. So the bottom line is, is the user won't even get it. Now here's the really cool part. If you're restarting this app, if you just go in and do a restart manually, it will continue to serve any kind of request from the old app until this one is ready to take over, then the old one goes away and this one catches up. Users won't see anything. So the bottom line is, is when we use Auto-Start Web Apps that first user does not experience those long wait times. Now here's something else to remember, watch for this on the exam. Auto-Start for your web applications is optional, it is turned off by default. If you want it to work, you have to turn it on. We'll talk about that in a separate video that's entitled Auto-Start Configuration, but remember it's off by default, you have to turn it on to use it and it does everything just like it did before, except it does not allow user requests to come in until the applications started up and it automatically starts the application up anytime that the application stops.
| Course: | Designing and Developing ASP.NET 4 Web Apps (Exam 70-519) |
| Author: | Mark Long |
| SKU: | 34292 |
| ISBN: | 978-1-61866-029-9 |
| Release Date: | 2011-12-31 |
| Duration: | 8.5 hrs / 108 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |