Equivalent of a Windows Service on OSX with Mono

2019-03-16 01:29发布

What do I need to do to have my .NET-Mono application run as a background process on OSX and start when the OS starts up? (Assuming the application is otherwise ready to go on OSX)

Related

Build an installer for .NET app that can run on Windows and OS X?

标签: .net macos mono
4条回答
做个烂人
2楼-- · 2019-03-16 01:38

this article might be a bit out of date but might be of use for OSX.

Since your mono process can run in the unix layer (assuming you have no need for a gui) then this should make things simpler.

查看更多
放荡不羁爱自由
3楼-- · 2019-03-16 01:44

You want to put a plist (this is an example of running CruiseControl.NET) in /Library/LaunchDaemons and the plist has to be owned by root. Also note as you are using LaunchD the process will always be running as root.

查看更多
劳资没心,怎么记你
4楼-- · 2019-03-16 01:47

As ShuggyCoUk notes, that article is very out of date. In 10.4, OS X made some some radical changes. The guide you want to read is System Startup Programming Topics. The short answer is "use launchd."

查看更多
成全新的幸福
5楼-- · 2019-03-16 01:59

Here's a blog post on what to add to your Info.plist to have your app run in the background and not have a dock icon.

查看更多
登录 后发表回答