【问题标题】:Hosting the WCF Service in windows service [closed]在 Windows 服务中托管 WCF 服务 [关闭]
【发布时间】:2008-10-30 13:40:07
【问题描述】:

如何在windows服务中托管WCF服务?

谢谢 塞卡

【问题讨论】:

    标签: wcf service


    【解决方案1】:

    我认为这篇文章很好地涵盖了所需的步骤: WCF Link

    总结一下:

    • 首先,您需要创建一个“Windows 服务”类型的新 Visual Studio 项目。
    • 接下来为了能够安装服务,您还需要编写一个如下形式的安装程序类:

    .

     [RunInstaller(true)]
     public class ProjectInstaller : Installer
     {
     }
    
    • 将您的 WCF 类添加到项目中,并且在 Windows 服务的 OnStart 和 OnStop 事件中,您必须显式启动您的 WCF 服务。

    • 在 Visual Studio 命令提示符下,您可以使用命令安装服务

    .

    installutil myservicename.exe
    

    【讨论】:

      【解决方案2】:
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-13
      相关资源
      最近更新 更多