Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

When using the WebActivator PreApplicationStart method, what actually triggers the methods bound to this to be run? When IIS7 has started the App Pool? When the first request is made to the webserver? Something else? If you have the answer, could you please also provide a reference to where you got this information?

Does any of this change in IIS 7.5?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
170 views
Welcome To Ask or Share your Answers For Others

1 Answer

WebActivator PreApplicationStart actually relies on ASP.NET PreApplicationStartMethodAttribute (see this link to see how web activator works).

PreApplicationStartMethodAttribute works when ASP.NET runtime starts up the application and the code runs early in the pipeline even before app_start event gets fired. So to answer your question, trigger would happen when first request is made to the web server (which will in turn kicks in application start up).

Note that trigger is related to ASP.NET app start and not with app pool. Your app pool might be running because of some other application (can be non ASP.NET app) but when first request comes for the ASP.NET app, this trigger would happen (for particular app) because application gets started.

If you are using auto-start feature then IIS will re-start your application on your app pool recycle and thus PreApplicationStart will get triggered.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...