我可以使用 Topshelf 托管多少服务?

How many services can I host with Topshelf?

Topshelf docs 说:

You can only have ONE service! As of 3.x Topshelf the base product no longer support hosting multiple services. This was done because the code to implement was very brittle and hard to debug. We have opted for a simpler and cleaner base product. This feature will most likely come back in the form of an add on nuget.

但这适用于 v.4 我们可以托管多个服务。我们是在做一些潜在的错误还是文档已经过时了?

您可以根据需要在一个盒子上安装任意数量的 Topshelf 主机服务 运行,但您过去能够在单个 Topshelf 主机中托管多个逻辑服务(例如 x.Service<MyService1>(...); x.Service<MyService2>(...);) .

您甚至可以使用实例参数多次 运行 同一 Topshelf 主机服务的多个实例。