Application Initialization not making a request to the initialization page


Setting up Application Initialization is pretty straight forward.  Instructions can be found here.

After setting it up the Application Initialization module with these parameters:

  • autoStart = True
  • startMode = AlwaysRunning

when IIS was restarted the W3WP worker process was started up and running just as expected.  Figure 1 shows a Process Explorer Properties window.

Figure 1, Process Explorer showing running W3WP worker process

The problem was that a ‘simulated’ request was not sent to the worker process after a restart so my ASPX file was not compiled.  Precompiling the file prior to the first request is a good idea and will certainly improve user experience for the first person to request that page after a restart.

I found that by setting the parameter preloadEnabled, shown in Figure 2, resulted in a pre-compilation of the file identified in the initializationPage parameter of my web.config.  This web.config file exists in the root directory for the web site which I configure Application Initialization for.

Figure 2, configure the preloadEnabled attribute

Before I made the change I stopped the application pool which I had configured for Application Initialization.  When I started the application pool again the W3WP worker process was indeed started as previous, but also the .NET Assemblies tab showed up in my Process Explorer as illustrated in Figure 3.  As well, there was a compiled ASP.NET file created in my C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root directory.

Figure 3, Process Explorer with .NET Assemblies tab present

I write this article because I missed that very important piece of the original instructions and felt it was worth mentioning again.  HTH.

 

 

 

 

 

Comments (3)

  1. Anonymous says:

    Hi Benjamin, thanks for all your great blog entries. I'd like to follow up on this one. I wonder if you may have ever encountered a different problem with getting the new app initialization feature to work, for other than localhost requests. It's quite a seeming limitation that I've not seen others talk about, but perhaps they've only used the new feature for demo purposes, and not on sites that using other domains.

    I discuss the problem in more detail in an iis.net forum message:

    forums.iis.net/…/1

    (I would have tried to send this to you directly, rather than as a blog comment, but I could find no email or twitter contact info. If you may prefer to respond to me by email, or would be so kind to notify me if you do reply here, my address is charlie (at) carehart (dot) org. Thanks so much for any thoughts.)

  2. Hi Charlie, my testings find that this feature sends a request to http://localhost:80 only.  If your site is on another port then you need to find another solution.  I tried many 'hacks' to try and trick the feature to change address, without luck.

    1. anno says:

      you can use hostName attribute to change the host of the init page, but “:80” is added anyway no matter if a port has been provided by you. I guess there’s no workaround for changing the port

Skip to main content