Want to host a WCF service using the NetNamedPipeBinding?  I did too.  Except IIS told me I couldn’t.  After some frustrated Bing’ing and Googl’ing I found my answer.

This article on MSDN outlines how to enable Net.Pipe in IIS7.  First you must enable the binding for the IIS site you are hosting the service in using this command (each command goes on a single line):

%windir%\system32\inetsrv\appcmd.exe set site "{YOUR_SITE_NAME}" -+bindings.protocol=’net.pipe’,bindingInformation=’*']

You can also accomplish this in the IIS Manager.  Click on the site you want to enable Net.Pipe on, then click “Bindings”:

image

Select net.pipe from the list and in the Binding Information put an asterisk “*” (no quotes)
image

Click OK and you’re done.  Using the IIS manager or the appcmd.exe will have the same effect.

Next we need to allow Net.Pipe for the virtual directory your service will be hosted in.

c:\windows\system32\inetsrv\appcmd.exe set app "{YOUR_SITE_NAME}/{Virtual_Directory"}" /enabledProtocols:http,net.pipe

This can be accomplished in the IIS Manager as well.  Click on the virtual directory you want to add net.pipe to and then click “Advanced Settings…”

image

Next, in the enabled protocols box add the protocols you want, separating them with a comma.
image

Click OK and you’re done.  Using the IIS manager or the appcmd.exe will have the same effect.

Once you have completed both these steps you should now be able to access your service over Net.Pipe after configuring the binding in your WCF service config.