static void Main(string[] args) { var ctx = new ServiceContext(); var service = new MailService(); ctx.LaunchCmdline(typeof(ICmdline), service); service.Launch(8090); ctx.Run(); }