IIS 10 Automatic Application Initialization system.webServer/applicationInitializationRSS

2 replies

Last post Dec 06, 2017 10:53 PM by jesper251783

  • IIS 10 Automatic Application Initialization system.webServer/applicationInitialization

    Dec 06, 2017 03:38 AM|jesper251783|LINK

    I am trying to set up automatic application initialization on IIS 10  on win server 2016 and under section system.webServer/applicationInitialization  I have set doAppInitAfterRestart to True. I have also manually included a static list of aspx files I want to have preloaded.

    This works well. It preloads the site after an IIS reset or pool recycle.

    However I am just wondering if instead of having to specify every single aspx file to prehit

    e.g.

      <system.webServer>
            <applicationInitialization skipManagedModules="false" doAppInitAfterRestart="true">
    <add initializationPage="/example1.aspx" hostName="localhost" />
    <add initializationPage="/example2.aspx" hostName="localhost" />
    <add initializationPage="/example3.aspx" hostName="localhost" />
    <add initializationPage="/example4.aspx" hostName="localhost" />
            </applicationInitialization>

    Am I able to instead get the whole Web App directory to get automatically scanned and preload the whole web app?

    for example something like

      <system.webServer>
            <applicationInitialization skipManagedModules="false" doAppInitAfterRestart="true">
    <add initializationWebApp="/exampleWebApp/*.aspx" hostName="localhost" />
            </applicationInitialization>

    This would be awesome because aspx files in our site often get changed, added or deleted, I can't find any detailed documentation on this whole process so any assistance would be incredibly appreciated.

    thanks again

  • Re: IIS 10 Automatic Application Initialization system.webServer/applicationInitialization

    Dec 06, 2017 08:58 AM|Yuk Ding|LINK

    Hi jesper251783,

    IIS should initialize the whole application when the first request access the website. So I think you only need to go to IIS manager->site/application level->advanced setting->preload->enable.

    Best Regards,

    Yuk Ding

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.
  • Re: IIS 10 Automatic Application Initialization system.webServer/applicationInitialization

    Dec 06, 2017 10:53 PM|jesper251783|LINK

    Hi Yuk Ding

    Thanks for your reply. Unfortunately I have tried that but the website does not preload with that alone.

    I have found that for the website to preload correctly I need 3 things set.

    1.  Application Pool needs the value Start Mode set to AlwaysRunning

    2. the Web Application needs the value Preload Enabled set to True

    At this point I would have thought the sites would preload correctly but they do not. I have also needed to

    3. Configuration Editor for the Web Application > navigate to Section: system.webServer/applicationInitialization

    and set doAppInitAfterRestart to True and also each aspx file that you want to have preloaded listed in the collection.

    If an aspx file is not listed in that collection it will not be preloaded.