System.UnauthorizedAccessException: Access to the path is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Pipes.NamedPipeClientStream.Connect(Int32 timeout)
at System.IO.Pipes.NamedPipeClientStream.Connect()
And in the debug output window:A first chance exception of type 'System.UnauthorizedAccessException' occurred in System.Core.dll
My best googling skills couldn't find an answer for this one and I ended up trying to change the permission for the NamedPipeServerStream and venturing down the wrong path by changing the PipeAuditRule and PipeAccessRule settings.
In the end turned out my PipeDirection had to be set to InOut, even though I was only streaming information from the Server, and not receiving information.
Here's the winning line of code:
NamedPipeServerStream Pipe = new NamedPipeServerStream(PipeName, PipeDirection.InOut, 1,
PipeTransmissionMode.Message, PipeOptions.None);
7 comments:
Thanks!
The MS example code is WRONG. And so is the code at: http://www.ehow.com/how_6053913_pass-visual-basic-application-another.html
It's simply amazing how poor the MS documentation is!
Folks like you are what makes life of a programmer tolerable.
Thank you! you saved me a lot of time!
"#¤%"! Thanks :)
Another satisfied customer. Thank you so much!
THANK YOU SO MUCH
wow ^^ thank you
Ditto! Thank you. You saved me hours.
Post a Comment