如何部署。。

解决方案 »

  1.   

    增加一个类:
    [RunInstaller(true)]
    public class ProjectInstaller : Installer
    {
    #region Windows服务属性设置 private ServiceInstaller serviceInstaller;
    private ServiceProcessInstaller processInstaller; public ProjectInstaller()
    {
    processInstaller = new ServiceProcessInstaller();
    serviceInstaller = new ServiceInstaller(); // 服务将在系统帐户下运行
    processInstaller.Account = ServiceAccount.LocalSystem;
    // 服务将具有手动的启动类型
    serviceInstaller.StartType = ServiceStartMode.Manual;
    // 服务名称
    serviceInstaller.ServiceName = "xxx";
    // 服务显示名称
    serviceInstaller.DisplayName = "xxx"; Installers.Add(serviceInstaller);
    Installers.Add(processInstaller);
    } #endregion
    }
    然后,创建一个setup项目,在File System里找到Customer Action,然后给Install,...Unintall等四项都添加Primary output(主输出),主输出指向你的WindowsService项目即可。
      

  2.   

    to :
    lovvver(www.notsoft.cn) ( )
    谢谢 ,麻烦能不能说下为什么要设Install,...Unintall等四项 
    我只设Install不可以马?