Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NamedPipeClientStream and "Access to the path is denied"

4,943 views
Skip to first unread message

Matt Houser

unread,
Nov 9, 2009, 12:53:33 PM11/9/09
to
I am trying to create a NamedPipeServerStream as one user (non-admin, domain
account) from one C# console app and then connect to it via
NamedPipeClientStream as another user (non-admin, domain account) from
another C# app. I am getting an "Access to the path is denied" exception.
Both apps are running on the same computer (windows 7). I am running one
app via "Run as different user".

Both ends are being opened as PipeDirection.InOut

If I run both ends as the same user, all is ok.

Does anyone have any ideas?

...Matt

Matt Houser

unread,
Nov 11, 2009, 4:05:02 PM11/11/09
to
Solution found. If I do this to create the pipe, it works.

PipeSecurity pipeSecurity = new PipeSecurity();
pipeSecurity.AddAccessRule(new PipeAccessRule("Everyone",
PipeAccessRights.ReadWrite,
system.Security.AccessControl.AccessControlType.Allow));
using (NamedPipeServerStream pipe = new
NamedPipeServerStream("pipetest", PipeDirection.InOut, 1,
PipeTransmissionMode.Message, PipeOptions.None, 512,
512, pipeSecurity, HandleInheritability.None))

The trick was setting up the security.

"Matt Houser" <ma...@houser.ca> wrote in message
news:5ECD9ADD-5044-4831...@microsoft.com...

0 new messages