locked
preloadenabled and serviceAutoStartProvider in web application RRS feed

  • Question

  • User-36939587 posted

    In IIS 7.5 it's possible to use autostart feature, but one thing is not clear for me. You can configure auto start for each application, since application pool can be used in several applications. There are such properties: serviceAutoStartEnabled, preloadEnabled and serviceAutoStartProvider

    If preloadEnabled is set to true, then fake request is send to application and Application_Start in Global.asax is executed. That is ok. Here I can do initialization. But also it's possible to use custom autostart provider and implement IProcessHostPreloadClient interface. For me it's not clear common different between custom provider and fake request - in what cases which is better.

    Should I use one of them only (custom provider or just auto start)? I noticed that IIS always execute custom provider and Application_Start method and it's not clear in what cases it's better to use custom provider and in what auto start only. For me both are almost similar and I unable to find some info which describe in what cases which of them should be used.

    Any help?

    Friday, May 24, 2013 1:10 AM

Answers

  • User-166373564 posted

    Hi darius

    I think you can learn the mechanism of Application_Start first,

    Application_Start is pseudo handler that ASP.NET checks for during initialization of an ASP.NET application - if one exists it's fired during the application's initialization process which occurs specifically when the HttpRuntime instance is started. Effectively Application_Start is fired exactly once when the Web application's AppDomain starts. Application_Start is simply a short cut that makes it consistent with the other Application_ events that are available in global.asax.cs even though it is not actually an HttpApplication event like most other Application_ handlers.

    You can also learn more details about IIS and Application_Start Debugging here,

    hope it helpful for you to understand it better,

    With regards

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 28, 2013 6:37 AM
  • User-36939587 posted

    Hello,

    thank you for suggestion. Finally I decided to use Application_Start only and to avoid usage of IProcessHostPreloadClient interface.

    Reason of that is that it's simplier configuration and HTTP application. I found, that IProcessHostPreloadClient should be used in WCF applications which are not HTTP applications. Conclusion:

    1. If application is HTTP application only, then it's ok to use Application_Start only.
    2. If application can be HTTP and non-HTTP, then probably it's better to use both of them. Application_Start for http, and custom provider when used as non-HTTP.

    3. Use custom provider for non-HTTP applications.

    I hope that will help for someone. Smile

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 29, 2013 2:26 AM

All replies

  • User-166373564 posted

    Hi darius

    I think you can learn the mechanism of Application_Start first,

    Application_Start is pseudo handler that ASP.NET checks for during initialization of an ASP.NET application - if one exists it's fired during the application's initialization process which occurs specifically when the HttpRuntime instance is started. Effectively Application_Start is fired exactly once when the Web application's AppDomain starts. Application_Start is simply a short cut that makes it consistent with the other Application_ events that are available in global.asax.cs even though it is not actually an HttpApplication event like most other Application_ handlers.

    You can also learn more details about IIS and Application_Start Debugging here,

    hope it helpful for you to understand it better,

    With regards

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 28, 2013 6:37 AM
  • User-36939587 posted

    Hello,

    thank you for suggestion. Finally I decided to use Application_Start only and to avoid usage of IProcessHostPreloadClient interface.

    Reason of that is that it's simplier configuration and HTTP application. I found, that IProcessHostPreloadClient should be used in WCF applications which are not HTTP applications. Conclusion:

    1. If application is HTTP application only, then it's ok to use Application_Start only.
    2. If application can be HTTP and non-HTTP, then probably it's better to use both of them. Application_Start for http, and custom provider when used as non-HTTP.

    3. Use custom provider for non-HTTP applications.

    I hope that will help for someone. Smile

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 29, 2013 2:26 AM