WCF service with Named Pipe Binding on multiple sites in IIS7

A named pipe is a system kernel object that processes on the same server may use for communicating with each other. It is a fast, secure, and reliable way for your applications to access on-machine WCF services.

While working on the test server that hosted multiple sites in IIS7 (test, uat, staging, etc.), I have noticed that for a single web service all sites used the same named pipe - you can look at all named pipes defined on your system using a tool like PipeList. Needless to say, reusing the same named pipe is not a desirable behavior in this situation.

I looked closer into the issue. From what I now understand, WCF uses an algorithm that maps a service path to the pipe name. By default, this algorithm ignores the domain name of the site and, thus, all sites on the server map services with the same local path to the same named pipes.

That explain the root cause of the issue. How can we get it fixed? How can we force the algorithm to take the domain name into acount when creating a named pipe?


The first step is to set the hostNameComparisonMode attribute to Exact in the NetNamedPipeBinding configuration of your service:

<netNamedPipeBinding>

    <binding  name="YourNamedPipeBinding"  hostNameComparisonMode="Exact" />

</netNamedPipeBinding>


The second step is to modify the net.pipe binding on each IIS7 website:

Named Pipe Binding Information


Hope it helps. Happy coding!

How to set up FDF Toolkit on Windows Server 2008 and IIS 7

I have been moving a number of web applications from 64-bit Windows Server 2003 and IIS 6 running in 32-bit mode to 64-bit Windows Server 2008 and IIS 7. During testing we discovered the following COM exception when trying to pre-populate an FDF form using FDF toolkit 6:

0x80040154: Retrieving the COM class factory failed.

It turned out that FDF Toolkit 6 has been compiled only for a 32-bit OS. Thus, in order to make it work with IIS 7, you will need to register FDF Toolkit using the 32-bit version of regsvr32.exe. You will also need to enable 32-bit applications in your application pool.

Happy coding!

Welcome to ModelBlog

Thank you for visiting ModelBlog. We hope the time you spend with us will be both entertaining and worth your while. Have fun!

Authors

Search

Archive

Tags