Setting Up Site Bindings in IIS on Windows 8

One of the products I am working on these days has a WCF component. WCF service is using flexible bindings, so you can configure the service to run locally (via direct invocation) or via a WCF proxy using either HTTP, named pipes or TCP bindings.  I have set this up before by creating a new site in IIS on my local machine, then adding the other two bindings to a site in IIS – net.tcp and net.pipe. After I upgraded my machine to Windows 8, I found out that this functionality seems to be broken in the version of IIS 8.0 that comes with Windows 8.

When I tried to do that, I got NullReferenceException. 


So, I had to find a workaround.  Luckily, when you install IIS, you get command line utility appcmd.exe that comes with it.  It is installed by default in C:WindowsSystem32InetSrv folder. If you type “appcmd /?” at the prompt you will get full help for that utility. So, with two commands I was able to add the bindings that I needed to enable WCF with multiple bindings.

appcmd set site /  /+bindings.[protocol='net.tcp',bindingInformation='82:*']
appcmd set site /  /+bindings.[protocol='net.pipe',bindingInformation='*']

With the configuration above my net.tcp is enabled on port 82. For named pipes you have to just type in * because there is technically no port that it is running on. You also need to go to advanced settings of the site and add two more protocols to the protocols settings, separated by comma. 



Hope this helps someone else.



Leave a Reply

Your email address will not be published. Required fields are marked *