title: Connecting via named pipe from windows service (session#0) to desktop app (session #1)
body: <p><strong>Given</strong>:<br>
   - the application - desktop GUI (WPF) .NET app<br>
   - windows service watching for application (.NET also) </p>
  
  <p>The windows service periodically "pings" application to get sure it's healthy (and if it's not winservice will restart it).<br>
  I was going to implement "pinging" via named pipes. To make things simpler I decided to do it with WCF. The application hosts a WCF-service (one operation Ping returning something). The windows service is a client for this WCF-service, invokes it periodically based on a timer.</p>
  
  <p>That's all in Windows 7.<br>
  Windows service is running under LocalService (in session#0).<br>
  Desktop application is running under currently logged in user (in session#1).  </p>
  
  <p><strong>The problem</strong>:<br>
  Windows service can't see WCF endpoint (with NetNamedPipeBinding) created in and being listened in desktop application. That means that on call via wcf proxy I get this exception: "The pipe endpoint 'net.pipe://localhost/HeartBeat' could not be found on your local machine"</p>
  
  <p>I'm sure code is ok, because another desktop application (in session#1) can see the endpoint.</p>
  
  <p>Obviously here I'm dealing with some security stuff for Win32 system object isolation.
  But I believe there should be a way to workaround restrictions I've encountered with.<br>
  I can sacrifice WCF approach and go the raw NamedPipe way.</p>