我想启动以下 WCF 服务:
<system.serviceModel>
<services>
<service name="MTPlatform">
<endpoint address="TradingService" behaviorConfiguration="ServiceBehaviour"
binding="netNamedPipeBinding"
bindingConfiguration="NetNamedPipeBinding_IGenericTradingInterface"
contract="GenericTradingInterface.IGenericTradingInterface"
name="TradingService" />
<endpoint address="mex" binding="mexNamedPipeBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.pipe://localhost" />
</baseAddresses>
<timeouts closeTimeout="00:00:02" openTimeout="00:00:20" />
</host>
</service>
</services>
<bindings>
<netNamedPipeBinding>
<binding name="NetNamedPipeBinding_IGenericTradingInterface"
closeTimeout="00:05:20" openTimeout="00:00:20" receiveTimeout="05:20:00"
sendTimeout="00:10:00" transactionFlow="false" transferMode="Buffered"
transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483646" maxBufferSize="2147483646" maxConnections="10"
maxReceivedMessageSize="2147483646">
<readerQuotas maxDepth="2147483646" maxStringContentLength="2147483646"
maxArrayLength="2147483646" maxBytesPerRead="2147483646"
maxNameTableCharCount="2147483646" />
<security mode="Transport">
<transport protectionLevel="EncryptAndSign" />
</security>
</binding>
</netNamedPipeBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="ServiceBehaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="MetaDataBehavior">
<serviceMetadata />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
这失败了:
在服务 MT5Platform 实施的合同列表中找不到合同名称“IMetadataExchange”。将 ServiceMetadataBehavior 添加到配置文件或直接添加到 ServiceHost 以启用对此协定的支持。
我在这里看不到大错误,在哪里可以找到IMetadataExchange
?
谢谢,
于尔根