Client on non-admin user can't communicate using net.pipe with services

喜你入骨 提交于 2019-11-30 00:33:03

问题


I have a client app that hosts a WCF service using net.pipe protocol. The client can't communicate with other WCF services which are running under the admin user.

I have read that you can't communicate using net.pipe between different users.

Is there way to by pass it?


回答1:


I have read that you can't communicate using net.pipe between different users.

This isn't true in general. Here is a summary of what I think you are referring to:

If you are running on an operating system earlier than Windows Vista there is no problem: any process should be able to host a WCF net.pipe service accessible to any other local process.

If you are running on Windows Vista or later, a WCF net.pipe service will only be accessible to processes running in the same logon session (e.g. within the same interactive user's session) unless the process hosting the WCF service is running with the elevated privilege SeCreateGlobalPrivilege.

Windows Services run in their own logon session, and have the privilege SeCreateGlobalPrivilege, so self-hosted and IIS-hosted WCF net.pipe services are visible to processes in other logon sessions on the same machine.

In most scenarios I have come across where this is an issue, the workaround is to always host the WCF service in a Windows Service, using a duplex contract if necessary to reverse the client and server roles during an interaction session.

See also:

  • Minimum OS Permissions required to create named pipe (WCF)
  • Getting EndpointNotFoundException with NetNamedPipeBinding in C#; Need To Create Global Named Pipe
  • Connecting via named pipe from windows service (session#0) to desktop app (session #1)


来源:https://stackoverflow.com/questions/12072617/client-on-non-admin-user-cant-communicate-using-net-pipe-with-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!