【问题标题】:How to deploy WCF service application on IIS如何在 IIS 上部署 WCF 服务应用程序
【发布时间】:2013-09-13 05:52:02
【问题描述】:

我是WCF服务的新手。我做了一个服务应用程序,并将应用程序代码目录放在IIS的默认网站下。它与我的客户端连接得很好。

我想知道如何在 IIS 上以二进制形式部署我的服务,目前我的整个源代码在服务器上可见

【问题讨论】:

    标签: c# wcf


    【解决方案1】:

    称为WCF服务发布

    查看MSDN Documentation

    发布后,服务器中只有程序集文件、Web.config 文件和 .svc 文件

    【讨论】:

      【解决方案2】:

      1:从VS发布你的wcf服务应用并给出发布路径。

      2 : 在 IIS 中创建一个指向发布目录的虚拟目录

      3 : 将虚拟目录默认页面设置为应用程序的 .SVC 文件。

      然后尝试浏览它..我希望你现在能够成功..

      【讨论】:

        【解决方案3】:

        礼貌:http://social.msdn.microsoft.com/Forums/vstudio/en-US/5c0a54e7-af4b-422f-bf5d-5f2f93d46ed0/deploying-wcf-service-to-iis-75

        1. 您需要在 IIS 上为您的 WCF 应用程序创建一个新应用程序。

        2. 要在 IIS 上使用特定端口配置服务作为nettcp 端点端口,您需要编辑“默认网站”上的“绑定...”部分,更改“net.tcp”类型绑定以使用您的需要的端口,(例如,要使用 22550,请将 Binding 信息设置为“22550:*”)

        3. 您可以使用相对 URI 设置 nettcp 端点地址。 IIS 会自动将地址转换为绝对 URL。 #iv-v),要在 IIS 应用程序上启用nettcp 协议,您可以在特定的 IIS 应用程序上打开“高级设置”,编辑“启用的协议”对,添加“net.tcp”。

        4. 是的,添加一个 MEX 端点,并将 serviceMetadata 添加到 ServiceBehavior。请参阅此配置示例:

        
          <system.serviceModel>
            <services>
              <service name="nettcp_wcf.Service1" behaviorConfiguration="nettcp_wcf.Service1Behavior">
                <!--use relative url-->
                <endpoint address="nettcp" binding="netTcpBinding" contract="nettcp_wcf.IService1">
                </endpoint>
                <!--add mex endpoint-->
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
              </service>
            </services>
            <behaviors>
              <serviceBehaviors>
                <behavior name="nettcp_wcf.Service1Behavior">
                  <!--enable metadata service-->
                  <serviceMetadata httpGetEnabled="true"/>
                  <serviceDebug includeExceptionDetailInFaults="true"/>
                </behavior>
              </serviceBehaviors>
            </behaviors>
          </system.serviceModel>
            
        

        这里有一篇关于配置IIS托管nettcp WCF的文章,请看: http://blogs.msdn.com/swiss_dpe_team/archive/2008/02/08/iis-7-support-for-non-http-protocols.aspx

        【讨论】:

          猜你喜欢
          • 2011-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多