.net windows service开发与安装
2013-05-19 11:47
197 查看
1、创建一个Windows Service项目名为WindowsServiceTest;
2、添加一个Windows Service项名为TestService.cs;
3、实现TestService类的OnStart和OnEnd;
4、右键点击TestService的设计视图,选择右键菜单项Add Installer,vs自动创建一个ProjectInstaller.cs类,ProjectInstaller.cs中自动附带了两个serviceInstaller1和serviceProcessInstaller1成员;(在serviceInstaller1和serviceProcessInstaller1中根据实际设置启动帐户和启动方式)
5、Build完成,创建一个install.bat批处理文件,如下用于安装:
如下用于卸载:
2、添加一个Windows Service项名为TestService.cs;
3、实现TestService类的OnStart和OnEnd;
4、右键点击TestService的设计视图,选择右键菜单项Add Installer,vs自动创建一个ProjectInstaller.cs类,ProjectInstaller.cs中自动附带了两个serviceInstaller1和serviceProcessInstaller1成员;(在serviceInstaller1和serviceProcessInstaller1中根据实际设置启动帐户和启动方式)
5、Build完成,创建一个install.bat批处理文件,如下用于安装:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil d:\output\WindowsServiceTest.exe pause
如下用于卸载:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil d:\output\WindowsServiceTest.exe -u pause
相关文章推荐
- .net开发的windows service 安装和卸载,批处理
- 一起谈.NET技术,WPF Multi-Touch 开发:Windows 7 安装多点触屏模拟器
- 用于 IT 专业人员和开发人员的 Windows XP Service Pack 2 网络安装软件包
- [.NET] : Windows Service的安装专案
- Visual Studio.net 2010 Windows Service 开发,安装与调试
- Windows Service开发日志二(安装与调试)
- Windows Service 开发,安装与调试
- 关于.Net开发的Windows的安装
- 关于.Net开发的Windows的安装
- .NET开发Windows Service程序 - Topshelf
- VS2010如何一步步开发添加Windows服务(Windows service)及服务安装启动
- WCF实例 —— Windows Service Host 开发,调试,制作安装包
- .Net开发的windows服务的安装
- windows service 开发、安装及调试
- windows 7 安装及.net开发环境搭建
- 通过cmd命令安装、卸载、启动和停止Windows Service(InstallUtil.exe)
- windows下的PHP开发环境安装
- .NET开发工具安装顺序问题
- 在Windows下安装Git开发环境
- spring boot 在windows下安装为service