How do you debug a Windows Service?

后端 未结 15 2839
春和景丽
春和景丽 2020-12-12 21:07

I read the MSDN article on the topic. To quote:

Because a service must be run from within the context of the Services Control Manager rather than

15条回答
  •  我在风中等你
    2020-12-12 21:49

    You could add some logging around the interop calls to find out which one fails.

    Also services by default aren't associated with a desktop; if you open the services.msc control panel applet, get the properties of your service, go to the "Log On" tab, you could check "Allow service to interact with desktop". This could fix the problem for you in some cases.

提交回复
热议问题