我的静态方法中有这段代码:
PipeSecurity ps = new PipeSecurity();
ps.AddAccessRule(new PipeAccessRule(System.Security.Principal.WindowsIdentity.GetCurrent().Name, PipeAccessRights.FullControl | PipeAccessRights.CreateNewInstance, AccessControlType.Allow));
var xserver = new NamedPipeServerStream("XSocketsPipe", PipeDirection.In);
xserver.WaitForConnection();
IFormatter f = new BinaryFormatter();
var messageReceived = (Connection)f.Deserialize(xserver);
XSocketsData.User.Add(messageReceived);
现在,当我执行我的应用程序时,我收到“拒绝访问路径”。错误。我究竟做错了什么?