如何配置TopShelf以将服务作为ServiceAccount.NetworkService运
发布时间:2020-12-14 01:36:46 所属栏目:Windows 来源:网络整理
导读:如何配置TopShelf以将服务作为ServiceAccount.NetworkService运行? https://github.com/Topshelf/Topshelf 解决方法 TopShelf的新位置 http://github.com/Topshelf/Topshelf已更新为允许此行为的补丁. RunConfiguration cfg = RunnerConfigurator.New(x ={
如何配置TopShelf以将服务作为ServiceAccount.NetworkService运行?
https://github.com/Topshelf/Topshelf 解决方法
TopShelf的新位置
http://github.com/Topshelf/Topshelf已更新为允许此行为的补丁.
RunConfiguration cfg = RunnerConfigurator.New(x => { x.AfterStoppingTheHost(h => { Console.WriteLine("AfterStop called invoked,services are stopping"); }); x.ConfigureService<TownCrier>(s => { s.Named("tc"); s.HowToBuildService(name=> new TownCrier()); s.WhenStarted(tc => tc.Start()); s.WhenStopped(tc => tc.Stop()); }); // Running as the network service account x.RunAsNetworkService(); x.SetDescription("Sample Topshelf Host"); x.SetDisplayName("Stuff"); x.SetServiceName("stuff"); }); Runner.Host(cfg,args); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-10 – 如何配置Windows 10不要在Edge中打开链接?
- 第四节:Windows系统安装时BIOS设置及注意
- windows-server-2008 – 如何将Windows 2008域控制器迁移到
- .net – Windows应用程序分析
- windows-installer – windows Installer – 当安装策略版本
- 在Windows Server 2003上安装PHP 5 – %1不是有效的Win32应
- Windows VPN服务器可以与VPN客户端通信,但不会将数据包从其
- Windows下安装的XAMPP如何设置Apache和MySQL等服务开机自启
- windows – 使用vbscript激活(带到前台)特定窗口
- Window中的Docker 拉取Mysql镜像 并在本地Navicate链接
推荐文章
站长推荐
热点阅读