请问各位大侠,我做了个windows服务,用installutil.exe注册后,怎么在服务列表里找不到啊?
还有如果我要讲windows服务做成安装程序,该怎么做啊?请有经验的朋友指点啊,我急用啊,在线等

解决方案 »

  1.   

    是不是没有安装成功?
    ServiceProcessInstaller
    ServiceInstaller
    你有没有用到
    安装程序简单的可以用命令行安装
      

  2.   

    用到了啊,但装和卸载时都提示:没有RunInstallerAttribute的公共安装程序,在windows服务的exe程序集中可能可以找到yes属性,我不太明白这样的提示
      

  3.   

    在你的服务里加一个初始化类:
    [RunInstallerAttribute(true)]
    public class ProjectInstaller: Installer
    { private ServiceInstaller serviceInstaller;
    private ServiceProcessInstaller processInstaller; public ProjectInstaller()
    {
    processInstaller = new ServiceProcessInstaller();
    serviceInstaller = new ServiceInstaller(); // 服务将在系统帐户下运行
    processInstaller.Account = ServiceAccount.LocalSystem;
    // 服务将具有手动的启动类型
    serviceInstaller.StartType = ServiceStartMode.Manual;
    // 服务名称
    serviceInstaller.ServiceName = "学习Service";
    // 服务显示名称
    serviceInstaller.DisplayName = "学习Service"; Installers.Add(serviceInstaller);
    Installers.Add(processInstaller);
    }
    }然后安装,在服务列表里就可以看到了。