.NET Windows服务 - 在一个项目中的多个服务 [英] .NET Windows Service - multiple services in one project

查看:389
本文介绍了.NET Windows服务 - 在一个项目中的多个服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我有一个Windows服务项目。我还创造了另一个安装项目,它安装在Windows服务。

Currently, I have a project with a Windows Service. I also created another "Setup Project" which installs the Windows Service.

我的问题是这样的:我可以添加其他Windows服务,以同一个项目? (这样一来,我可以使用1安装程序,并共享服务之间的一些code更容易)。如果可以,是否意味着当一个服务遇到错误,那么这两个服务被停止,或者他们单独错误每个出其他?

My question is this: Can I add another Windows Service to the same project? (This way, I can use 1 installer, and share some code between the services more easily.) If I can, does that mean when one service encounters errors then both services are stopped, or do they error out independently of each other?

是否有编码1服务每个项目,或有多项服务于一体的项目之间的任何其他区别?

Are there any other differences between coding 1 service per project, or having multiple services in one project?

推荐答案

是的,你可以在同一个项目的多个服务。尽管他们都使用相同的exe文件,它们被加载到不同的存储空间,并独立地行动彼此的。

yes, you can have multiple services in the same project. Although they both use the same exe, they are loaded into different memory spaces and act independently of each other.

这篇关于.NET Windows服务 - 在一个项目中的多个服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆