Here are the past articles in the series to get up to date:
The last part in this series is to bring the history of the named pipe up to the named pipe implementation in WCF.
Although the .Net framework now has a named pipe implementation in System.IO.Pipes, the WCF named pipe implementation actually precedes that by a few years (this is why there is a type System.IO.PipeException that comes in System.ServiceModel.dll). That means we directly sit on top of the native Windows named pipe implementation I talked about last time, such as the CreateNamedPipe function in kernel32.dll. Named pipes are probably our second largest source for using native methods after the queuing functions in mqrt.dll used by the MSMQ channel.
The basic building blocks that we use for a named pipe implementation are:
The named pipes in WCF are intended for use as a fast, local machine communication mechanism. Although a Windows named pipe can be used to connect to other machines, we use the security permissions of the pipe to deny network connections. This is done by denying the special well-known Network SID S-1-5-2 (there was previously an option on CreateNamedPipe to do this directly but that was deprecated in favor of the current approach). From time to time you might see this cause a problem with a service that bridges external communication from one service to talk to a second service over a named pipe. The Network SID is added to the process token when a user logs on across a network, preventing that logon from later talking across one of our named pipes.
As you might have guessed from the supported channel shapes and the information above, we use bidirectional pipes with overlapped IO operations. Both reads and writes are done using the pipe stream in message mode. These messages don’t equate to the messages you think of in your application (that’s what the higher-level message framing is for) but are instead to have coherent exchanges along the pipe.
Well, is this the reason for receiving an error, when a client is being impersonated in an ASP.NET application and then calling a service which is hosted inside another process?
I found someone else with the same problem (no solution): http://www.vistax64.com/indigo/163298-pipe-name-could-not-obtained-when-using-asp-net-impersona.html and posted this as question in MSDN forums (http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/c0ddf776-fb2b-4d03-bae6-1105a307d6ee) also no solution...
We worked around by moving this specific service to another binding, but I still have no clue what's the problem.
Hi marc,
That is one cause of that type of error.
The other cause is that your server does not have permission to create objects in the global namespace. We will in that case fall back (without complaining) to the local process namespace. When this happens, other processes cannot connect to the pipe as they can't find the endpoint. A similar effect can be caused by different Windows integrity levels of the two processes.