Jaa


Configure Auto-Start Using IIS Manager

This topic contains procedures to enable auto-start for an application, and a service by using IIS Manager. It also contains procedures to enable net.pipe binding for a Web site and net.pipe protocol for an application.

To enable auto-start for an application

  1. Open IIS Manager by clicking Start, clicking All Programs, clicking Windows Server AppFabric, and then clicking Internet Information Services (IIS) Manager.

  2. In the Connections pane, open the server and site containing the application, and then select the application.

  3. In the Actions pane, click Configure under the Manage WCF and WF Services heading in the Actions pane, or right-click the application, point to Manage WCF and WF Services, and then click Configure.

  4. In the Configure WCF and WF for Application dialog box, click Auto-Start.

    Important

    The auto-start configuration feature is only available on Windows 7 or Windows Server 2008 R2 and above. If your system has neither of these operating systems installed, you will not be able to configure auto-start unless you upgrade to one of them.

  5. In the Auto-Start dialog box, click Enabled to enable auto-start for all services within the application; click Custom to enable auto-start for each service in the application separately; or click Disabled to ensure that no service within the application will auto-start.

  6. If the application pool for the application is not set to AlwaysRunning, a pop-up dialog will be displayed with the message: "The application pool for this application/service needs to have its startMode set to AlwaysRunning in order for the application/service to successfully auto-start. Do you wish to set the application pool startMode when changes are applied?” Click Yes to set startMode for the application pool to AlwaysRunning, and then click OK.

    The auto-start feature for an application works only if you set startMode for the application pool used by the application to AlwaysRunning. Clicking OK on this dialog box will set the value of the startMode of application pool that the application uses to AlwaysRunning. You can also set this attribute by using IIS Configuration editor. Note that setting the startMode for an application pool to AlwaysRunning will restart all applications in the application pool.

  7. Click OK.

    The auto-start settings for an application are not defined in the application’s Web.config file, but in the ApplicationHost.config file for the server. You configure auto-start for an application locally in the configuration dialog box displayed at the application level, but the settings are in the ApplicationHost.config file. Here is a sample configuration:

    <application path="/MyWorkflowService" 
                applicationPool="MyWorkflowServiceAppPool" 
                enabledProtocols="http,net.pipe"
                serviceAutoStartEnabled="true"
                serviceAutoStartProvider="Service"
                serviceAutoStartMode="All">
    

    Enabling auto-start for all services in the application sets the serviceAutoStartMode attribute for the application in the ApplicationHost.config file to a value of “all”. Setting the mode to Custom sets the serviceAutoStartMode attribute to a value of “custom”. Either of these actions adds serviceAutoStartEnabled set to a value of “true” in the ApplicationHost.config file if the application is already running (i.e., protocols are enabled). If the application is not running, serviceAutoStartEnabled is set to false (so that an application that was intentionally stopped is not accidentally started).

    Important

    The autoStart attribute and startMode attributes of an application pool are different. The startMode attribute is the one that the auto-start feature of Microsoft AppFabric 1.1 for Windows Server uses. The Start application pool immediately setting in the Edit Application Pool dialog box or Start Automatically setting on the Advanced Settings dialog box of an application pool configures the autoStart attribute, not the startMode attribute.

    Warning

    Make sure that application pool is configured to use Integrated Managed Pipeline mode and that it uses .NET Framework version 4.

To enable auto-start for a service

  1. Open IIS Manager by clicking Start, clicking All Programs, clicking Windows Server AppFabric, and then clicking Internet Information Services (IIS) Manager.

  2. In the Connections pane, open the server and site containing the application, and then select the application.

  3. Set the auto-start values for the application as appropriate. To enable auto-start for a service, the auto-start mode must be set to Custom and startMode for the application pool must be set to AlwaysRunning. For more information, see “To enable auto-start for an application” in this topic.

  4. In the Features View, double-click the Services icon.

  5. Select the service that you want to enable auto-start for, and then in the Actions pane, click Configure, or right click the application and then click Configure in the context menu.

  6. In the Configure Service dialog box, click Auto-Start.

  7. In the Auto-Start dialog box, click Enable to enable auto-start for the service. Enabling auto-start for a service adds a serviceAddress line to the serviceAutoStart attribute for the service in the application Web.config file. Here is a sample configuration:

        <microsoft.applicationServer>
            <hosting>
                <serviceAutoStart>
                    <add relativeVirtualPath="Service1.xamlx" />
                </serviceAutoStart>
            </hosting>
        </microsoft.applicationServer>
    

    If the service belongs to an application whose auto-start mode is set to Disabled, the Enable check box will be cleared and will be unavailable. If the auto-start mode for the application is set to Enabled, the Enable check box will be selected and will be unavailable. Before you can enable auto-start for the service, you have to set the auto-start mode for the application to Custom. If auto-start for the application is enabled or disabled, the auto-start setting for all services within the application will be inherited from the auto-start settings for the application. To set auto-start for the application, return to the “To enable auto-start for an application” section earlier in this topic.

  8. Click OK.

    Note

    If you add a service in the root directory of a Web site, rather than in a virtual directory, then the service will be associated with the default application, not with a custom application. When a service is associated with the default application, you will not be able to configure auto-start for the service in the IIS Manager extensions, because the auto-start mode for the default application is set to Disabled and cannot be changed.

To set the startMode attribute of an application pool using IIS Manager

  1. In IIS Manager, click computer name in the Connection pane.

  2. Switch to Features View if the view is not active.

  3. Double-click Configuration Editor in the Management section of the Features View.

  4. Click the down-arrow for the Section field, expand system.applicationhost, and then click application pools.

  5. Click (Collection) and then click eclipses () next to the field that shows the count.

  6. In the Collection Editor, select the application pool for which you want to configure the startMode attribute.

  7. In the Properties window at the bottom, set the value of startMode attribute to AlwaysRunning.

To enable net.pipe binding at a site level

  1. Note

    Microsoft AppFabric 1.1 for Windows Server automatically adds the Service Management Service, a WCF service, to all applications with the serviceManagement attribute enabled. This attribute is enabled by default. This service requires that the net.pipe binding is enabled for the Web site and that the net.pipe protocol is enabled for the application. If you do not have these settings enabled, the auto-start feature fails to start this service and you will see error messages in the event log. For detailed information about the service, see Service Management Service.

    Right-click the site name in IIS Manager, and click Edit Bindings to launch the Site Bindings dialog box.

  2. If you do not see net.pipe binding in the Site Bindings dialog box, click Add to launch the Add Site Binding dialog box.

  3. In the Add Site Binding dialog box, select net.pipe for the Type field and type * for the Binding field.

  4. Click OK to close the Add Site Binding dialog box and then click Close to close the Site Bindings dialog box.

To enable net.pipe protocol for an application

  1. In the IIS Manager, right-click the name of the application containing the service.

  2. Point to Manage Application and then click Advanced Settings to launch.

  3. In the Advanced Settings dialog box Add a , (comma) character followed by net.pipe to the value of the Enabled Protocols field.

  4. Click OK to close the Advanced Settings dialog box and then click Close to close the Site Bindings dialog box.

Notes

To be able to enable or disable auto-start, the following conditions apply:

  • You must be using the Windows 7 or Windows Server 2008 R2 operating system. The auto-start tab is not available on other operating systems, such as Windows Vista or Windows Server 2008 before R2.

  • If you are configuring auto-start for an application remotely by using the IIS Manager, you must connect at the server level, not at the site or application level. Only then will you be able to apply settings to the ApplicationHost.config file at the server level, which is required for the application. (Note that you can configure auto-start for the service at whatever level you connect at remotely.)

  • If you enable auto-start at the application level, auto-start will work for that application only if the startMode for the application pool used by that application is set to AlwaysRunning.

  • You will be able to configure auto-start at the service level only if auto-start is enabled for the application containing the service and if the application mode is set to custom. If the application mode is set to all (auto-start for the application is enabled), the auto-start setting for all services within the application will be inherited from the auto-start settings for the application. If you enable auto-start for a service, and the startMode for the corresponding application pool is not set to AlwaysRunning, a warning will be displayed indicating that the startMode for the application pool must be set to AlwaysRunning.

  • If you add a service in the root directory of a Web site, rather than in a virtual directory, then the service will be associated with the default application, not with a custom application. When a service is associated with the default application, you will not be able to configure auto-start for the service in the IIS Manager extensions, because the auto-start mode for the default application is set to Disabled and cannot be changed.

  • The Advanced Settings dialog box for a Web site in IIS Manager contains a property named Start Automatically. This property must be set to True for the associated application pool to be started. If it is set to False, the application pool will never start, whether auto-start is enabled for the application pool or not. However, if Start Automatically is set to True, auto-start for the application pool can be either enabled (set to AlwaysRunning) or disabled. Setting Start Automatically to True does not guarantee that the application pool will be auto-started. To ensure that it is auto-started, you must both enable auto-start for the application pool and ensure that Start Automatically is set to True.

  • Microsoft AppFabric 1.1 for Windows Server automatically adds the Service Management Service, a WCF service, to all applications with the serviceManagement attribute enabled. This attribute is enabled by default. This service requires that the net.pipe binding enabled for the Web site and that net.pipe protocol is enabled for the application. If you do not have these settings enabled, the auto-start feature fails to start this service and you will see error messages in the event log. For detailed information about the service, see Service Management Service.

  2012-09-12