Running Windows Service Application without installing it

后端 未结 6 1876
旧巷少年郎
旧巷少年郎 2021-01-11 16:55

Whem I\'m writing a Windows Service and just hit F5 I get the error message that I have to install it using installutil.exe and then run it. In practice this me

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-11 17:30

    I usually put the bulk of the service implementation into a class library, and then create two "front-ends" for running it - one a service project, the other a console or windows forms application. I use the console/forms application for debugging.

    However, you should be aware of the differences in the environment between the debug experience and when running as a genuine service - e.g. you can accidentally end up dependent on running in a session with an interactive user, or (for winforms) where a message pump is running.

提交回复
热议问题