• WCF


    1. 在服务 Transfer 实现的协定列表中找不到协定名称 "IMetadataExchange"

    将 ServiceMetadataBehavior 添加到配置文件或直接添加到 ServiceHost,以启用对该协定的支持

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
      </startup>
      <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="exposeExceptionDetail">
              <serviceMetadata />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings>
          <netTcpBinding>
            <binding name="NetTcpBinding_ITransfer">
              <security mode="None"/>
            </binding>
          </netTcpBinding>
        </bindings>    
        <services>
          <service name="TestWcfScreen.Transfer"
                   behaviorConfiguration="exposeExceptionDetail">
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://localhost:8733/Transfer/" />
              </baseAddresses>
            </host>
            <endpoint address="" 
                      binding="netTcpBinding" 
                      bindingConfiguration="NetTcpBinding_ITransfer"
                      contract="TestWcfScreen.ITransfer">
            </endpoint>
            <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
          </service>
        </services>
      </system.serviceModel>
    </configuration>

    忘记添加 <serviceMetadata /> 这个标签

  • 相关阅读:
    11月12号实验课
    10月29日实验
    10.15实验课作业
    Idea的使用和设置
    常用的Linux命令
    KAFKA总结
    SpringBoot+Maven+MyBaties+Mysql快速搭建一个项目
    Spring 常见面试
    Windows下安装ZK kafka Mysql dubbo redis
    MySQL常见的面试题
  • 原文地址:https://www.cnblogs.com/luquanmingren/p/6911369.html
Copyright © 2020-2023  润新知