如何迁移使用单一个.NET Windows服务应用到Linux? [英] How to migrate a .NET Windows Service application to Linux using mono?

查看:356
本文介绍了如何迁移使用单一个.NET Windows服务应用到Linux?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是使用单一个.NET Windows服务迁移到Linux的最好的方法?我一直在试图避免执行的应用程序作为调度命令。

What would be the best approach to migrate a .NET Windows Service to Linux using mono? I've been trying to avoid executing the application as a scheduled command.

是否有可能获得服务/系统守护进程(在Linux)样的行为?

Is it possible to obtain a service/system daemon(in linux) like behavior?

推荐答案

在Linux下,守护程序是简单的后台进程。没有特殊的控制方法(如的start()停止())被用作Windows中。建立服务作为一个简单的(控制台)应用程序,并在后台运行。使用如 以进程 一个工具来运行一个程序作为Unix的守护进程,并记住指定作为程序被激活。

Under Linux, deamons are simple background processes. No special control methods (e.g start(), stop()) are used as in Windows. Build your service as a simple (console) application, and run it in the background. Use a tool like daemonize to run a program as a Unix daemon, and remember to specify mono as the program to be activated.

正如其他人,单服务是一台主机运行内置的<$服务C $ C> ServiceProcess 组装。专为Windows服务可以使用这个方法在Linux下运行未经修改的。您可以通过发送信号的过程(参见手册页)控制服务。

As noted by others, mono-service is a host to run services built with the ServiceProcess assembly. Services built for Windows can use this method to run unmodified under Linux. You can control the service by sending signals to the process (see man page).

这篇关于如何迁移使用单一个.NET Windows服务应用到Linux?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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