Iis – How to configure WCF Service to AutoStart in AppFabric when the services reside in the website root

appfabriciiswcf

I'm trying to configure my WCF services under WIndows Server 2008 R2's IIS and AppFabric to auto-start, but the steps listed at MSDN are possible only when the services reside in an application, but in my case, the .svc files reside directly in the site root.

This way, the 'Configure WCF and WF…' shows as '…for Site' and do not show the options for auto-start, as it would do if the application were hosted under an application sub-folder.

Does someone know what I'm doing wrong?

Best Answer

It is answered over here on MSDN, the one from SilverNinja is a better answer.

I found that the IIS UI is not that great for configuring applications - especially when trying to setup the Site Root as an autostart application. The best way to manage it is by using the Configuration Editor that comes with AppFabric under the Computer Name -> Management of Features View.

To make a Site Root an autostart application - you need to locate the Section system.applicationHost/sites and click the (Collection) entry. Click on your site name in the list of sites and click (Collection) once more. Select the application in the list and assign the serviceAutoStart="True", serviceAutoStartMode="All", and serviceAutoStartProvider="Service". Also enter net.pipe for the enabledProtocols ("http, net.pipe").

You also need to change the application pool setting to AlwaysRunning. To locate this setting, use the Collection Editor to navigate to the Section system.applicationHost/applicationPools. Click the (Collection) value and then select the application pool used by your root site and assign startMode="AlwaysRunning".

At this point, you can script your changes via "Generate Script" or apply them immediately using the "Apply" action. Hopefully this helps someone else who was as confused as I was about the issue. To test the configuration, you can issue an iisreset to see if your w3wp.exe process starts immediately.

Autostart Configuration MSDN Reference