Enabling Application Initialization in IIS
Published 05 December 2016
If you choose to use IIS to host the SQL Monitor web interface, and you wish to make use of the scheduled reporting feature to receive regular reports, then it will be necessary to enable the Application Initialization feature for IIS.
This module enables the website to be always running, even if the application pool is recycled or the IIS service is restarted.
Application Initialization in Windows Server 2008 R2 (IIS 7.5)
In Windows Server 2008 R2, use the Microsoft Web Platform Installer to install Application Initialization. Once installed, configure it by editing applicationHost.config, which is at %WINDIR%\system32\inetsrv\config.
- Open applicationHost.config in Notepad, being sure to run it with the “Run as Administrator” option.
- Find the <applicationPools> configuration section, and then look for the application pool running your gallery. If you don’t know the pool name, look it up in IIS Manager by right-clicking the application node in the left pane and choosing Manage Application > Advanced Settings. Add startMode=”AlwaysRunning” so that it looks like this:<add name=”.NET v4.5″ startMode=”AlwaysRunning” managedRuntimeVersion=”v4.0″ />
- Scroll down a little more in applicationHost.config to the <sites> configuration element. Find the entry for the gallery application and add preloadEnabled=”true” , like this:<application path=”/gallery” preloadEnabled=”true” applicationPool=”.NET v4.5″>
- Restart IIS by executing iisreset in a command prompt running as an administrator.
Application Initialization in Windows Server 2012 and higher (IIS 8+)
In Windows Server 2012 and higher, Application Initialization is included in the OS but it must be enabled in the Add Roles and Feature Wizard:
Once installed, you can now configure it with IIS Manager – no need to edit applicationHost.config.
- Open IIS Manager and navigate to the application pool the gallery is running under. Right click it and choose Advanced Settings. Verify the Start Mode is set to AlwaysRunning. In Win Server 2012, you also need to set Start Automatically to True (this setting was removed in 2012 R2). Click OK.
- In the left pane of IIS Manager, navigate to the gallery web application. Right click the application node and select Manage Application > Advanced Settings. Set Preload Enabled to True.
- Restart IIS by executing iisreset in a command prompt running as an administrator.