I've been reading Scott Guthrie's post on Auto-Start ASP.NET Applications, which provides examples on how to setup an ASP.NET 4.0 application to auto-start.
<applicationPools>
<add name="MyAppWorkerProcess" managedRuntimeVersion="v4.0"
startMode="AlwaysRunning" />
</applicationPools>
<!--...-->
<sites>
<site name="MySite" id="1">
<application path="/" serviceAutoStartEnabled="true"
serviceAutoStartProvider="PreWarmMyCache" />
</site>
</sites>
<!--...-->
<serviceAutoStartProviders>
<add name="PreWarmMyCache" type="PreWarmCache, MyAssembly" />
</serviceAutoStartProviders>
What is unclear from his post is if the following configuration will auto-start an ASP.NET application:
<applicationPools>
<add name="MyAppWorkerProcess" managedRuntimeVersion="v4.0"
startMode="AlwaysRunning" />
</applicationPools>
<!--...-->
<sites>
<site name="MySite" id="1">
<application path="/" serviceAutoStartEnabled="true" />
</site>
</sites>
The difference here is that there is no class specified to start-up. Ideally the application would just be loaded. The documentation on Application for a Site implies that the serviceAutoStartEnabled
attribute requires a serviceAutoStartProvider
attribute to work. But there is no indication of what happens if the additional attribute is not provided.
- Am I reading the documentation correctly?
- Is a
serviceAutoStartProvider
required to be specified to utilizeserviceAutoStartEnabled
? - What happens if no
serviceAutoStartProvider
is specified?