简体   繁体   中英

Can I host a wcf service in a tray app

I have a small tray app which should inform the user about start and stop of an execution of an other process running under local system account. The process running with local system account is called by another service (not owned by me). "My service process" is always running just for a short time. So I can not implement a wcf callback handling. Everything works fine on my machine. But it is not running at the customer side.

The problem (exception) which occurs at the customer side is something like "there is no endpoint listening on net.pipe..."

But the tray is running. I created a test app (console) to communicate with the tray. This works fine. If I start this test app with psexec -I ... to run it with a local system account it is also running. I have no idea about possible reasons and so I have two questions:

  1. is it "allowed" to host a wcf service in a tray app (running in user context) and call it by a process running in local system account?
  2. if yes, is there a possible policy/security setting which can prevent this functionality?

The only workaround I could think off is to create a helper service which I can use as some kind of a broker (connect from tray with a callback interface which could be used by the other process). But this seems to be a big overhead...

The answer is, it is not possible.

The reason is explained here: Connecting via named pipe from windows service (session#0) to desktop app (session #1)

It looks like my test was successful, because psexec was still running in session #1. My implementation is now using the already above described workaround

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM