Quantcast
Viewing all articles
Browse latest Browse all 27852

IIS 7.5 serviceAutoStartProvider strange behaviour

I am running into a bit of an issue whereIIS7.5 is exhibiting some strange behavior when using a single serviceAutoStartProvider across multiple app pools. Basically I have two different applications, in two different AppPools using the same serviceAutoStartProvider. When one AppPool starts, it will execute the Preload method for the application in that AppPool (as expected), but it also executes the Preload method for the application in the other app pool.

Here is an overview of the setup.

-- applicationHost.config file

<applicationPools>

                <addname="AppPoolA"managedRuntimeVersion="v4.0"startMode="AlwaysRunning" />

                <addname="AppPoolB"managedRuntimeVersion="v4.0"startMode="AlwaysRunning" />

</applicationPools>

 

<serviceAutoStartProviders>

                <addname="MyAutoStartProvider"type="MyAutoStartProvider, MyAssembly" />

</serviceAutoStartProviders>

 

<sites>

                <sitename="Default Web Site"id="1">

                                <applicationpath="/MySiteA"applicationPool="AppPoolA"serviceAutoStartEnabled="true"serviceAutoStartProvider="MyAutoStartProvider">

                                                <virtualDirectorypath="/"physicalPath="C:\inetpub\wwwroot\MySiteA" />

                                </application>     

                                <applicationpath="/MySiteB"applicationPool="AppPoolB"serviceAutoStartEnabled="true"serviceAutoStartProvider="MyAutoStartProvider">

                                                <virtualDirectorypath="/"physicalPath="C:\inetpub\wwwroot\MySiteB" />

                                </application>

                </site>

</sites>

 

 

// Auto Start Entry Point.... Both applications have their own copy of the assembly

 

publicclassMyAutoStartProvider : System.Web.Hosting.IProcessHostPreloadClient

{

                publicvoid Preload( string[] parameters )

                {

 

                                // Start a several long running processes here...

 

                }

}

 

 

Example Scenario:

AppPoolA and AppPoolB are both stopped.

When AppPoolA is started MySiteA runs its MyAutoStartProvider.PreloadBUT MySiteB ALSO runs its own preload even though it is in a different application pool (AppPoolB) which isstopped.

 

The same happens when starting AppPoolB, it will run the Preload for MySiteB and MySiteA.

 

This seems like it may be an IIS bug. Is this expected behaviour (if so why?), or is it an issue that is known about? Also what are the suggestions to work around the issue (obvious one that comes to mind is oneserviceAutoStartProviderper AppPool)?


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>