3
votes

Scenario

I am attempting to auto-start/keep-alive/preload information in my ASP.Net application. The instructions are plain and clear: ASP.Net + IIS 7.5 - Preloading & Auto Starting, but I am having problems with doing so in IIS 7.5 Express. I get a 500.19 error regarding some of the config elements. Below is context and question:

ApplicationHost.config

<!-- Inside the ApplicationPools element we tell the appropriate app pool 
     to auto start and always run. -->
<add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" startMode="AlwaysRunning" />

<!-- In the Sites element we first ensure our application is using the correct 
     app pool. Then we tell it to use the pools auto start functionality, and 
     point it towards a provider to use. -->
<site name="ED.Web" id="11">
    <application path="/" applicationPool="Clr4IntegratedAppPool" serviceAutoStartEnabled="true" serviceAutoStartProvider="Preload-UserReconciliation">
    <!-- everything is properly closed -->


<!-- Just before closing the Sites element we declare a provider; it identifies 
     the class within a particular assembly that should be used for preloading -->
    <serviceautostartproviders>
        <add name="Preload-UserReconciliation" type="ED.Web.ApplicationPreload, ED.Web" />
</serviceautostartproviders>
</sites>

Error 1

Error 500.19, Unrecognized element 'serviceautostartproviders'

239:    <serviceautostartproviders>
240:        <add name="Preload-UserReconciliation" type="ED.Web.ApplicationPreload, ED.Web" />

Error 2 [EDIT]

After shutting down IIS Express entirely, and launching the app from VS again, I get a Visual Studio popup: "Unable to launch the IIS Express Web server."

Question

How do I properly setup IIS Express 7.5 to start the pool, and preload the app using my ApplicationPreload : IProcessHostPreloadClient class?

1
Don't see the opening <sites> tag in your snippet..? Longshot, probably, but sometimes the simple things...... :) Actually, doesn't the entire <sites> block belong before the <serviceautostartproviders> section? Looks like they may be nested in your sample.. - David W
Thanks for the reply. The comments explain where those particular elements are placed. The XML structure is 100% ok (at least it matches the instructions on ASP.Net) :) - one.beat.consumer
Good enough..just looking at a sample from there where the two were separate, and saw the nested ones in your snippet... - David W
Check the answer. I deserve to be scolded by programmer nuns. - one.beat.consumer
LOL easy to overlook. Didn't notice it myself, either :) - David W

1 Answers

1
votes

Embarassing...

http://www.iis.net/download/ApplicationInitialization

I completely missed that this was an out-of-band module for IIS 7.5, not base functionality.

It is included in base functionality beginning with IIS 8.0.

The original post I found with this information on it, did not point that out, and when I used the link referenced in question, I completely breezed over the bright yellow box looking only at the code.