Opening IE through WCF

后端 未结 3 1387
清酒与你
清酒与你 2021-01-21 10:01

I have a WCF service hosted in a Windows service.

This service the WCF have one metohd and in this method I have one important line :

 Process Browser =          


        
相关标签:
3条回答
  • 2021-01-21 10:18

    http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/63a7d1ec-7077-489a-a250-f7422f04317b

    " in order to get the service to actually show the UI, you'd have to set the service in Computer Management to allow it to interact with the desktop. In the services window in computer management, go to the properties of your service, and on the Log On tab, check "Allow service to interact with desktop" "

    0 讨论(0)
  • 2021-01-21 10:18

    Under what user is the service running? Try running it under the currently logged in user, with privileges to interact with the desktop and see if that helps.

    In general, its not a great idea to have services launching GUI processes. For example, what if no one is logged on. What if many people are logged on? Should it open in all sessions... etc. Have you considered exposing a simple (e.g. Net.NamedPipes) endpoint on your service, and writing a small client UI to interact with it?

    0 讨论(0)
  • 2021-01-21 10:27

    Since Windows Vista MS has been adding lots of security-related changed esp. in the area what Windows Services can/can't do. Anything "desktop-like" (printing, accessing network shares, using Office Interop etc.) is harder and harder to get working.

    You should rethink your design since IMHO any "server-like process" (for example a WCF service) can be accessed in parallel by multiple requests and thus should NOT use processes which are NOT designed for this type of interaction... what happens if your webservice starts multiple IE instances that way ? Will IE behave as you need/expect it ?

    IF you really really MUST do it this way you should have

    • a normal desktop process hosting the WCF service

    OR

    • two processes, one your Windows Service and one running as a normal desktop process dealing with IE... these two process communicate via IPC
    0 讨论(0)
提交回复
热议问题