Windows Service vs Windows Application - Best Practice

前端 未结 3 516
无人共我
无人共我 2020-12-13 19:11

When should I go for a Windows Service and when should I go for a \"Background Application\" that runs in the notification area?

If I\'m not wrong, my design decisio

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 19:21

    My general rules of thumb are as follows

    • If it needs to always run, it's a service.
    • If it needs to be run under a particular user account, Network Service, Local System, generally it's a service (or a COM+ application)
    • If the user needs some control over it, it's generally a notification area application.
    • If it needs to notify the user of something, it's a notification area application

    The fun comes when you have the need to run something as a system account, but also interact with it. IIS is a good example of this, it's a service, but the administration is an application - it needs to be running at the startup, it needs access to particular things a user can't normal access (c:\inetpub), but the user needs to be able to start, stop and configure it.

提交回复
热议问题