【发布时间】:2014-09-29 22:24:01
【问题描述】:
我正在尝试让 wcf 服务在 Windows 服务主机中运行。我目前 收到错误“找不到与绑定 MetadataExchangeHttpBinding 的端点的方案 http 匹配的基地址。注册的基地址方案是 [net.tcp]。”
我正在使用 .Net Framework 4.5
我正在尝试获取 tcp.net 二进制服务。任何帮助表示赞赏。我拥有的跟踪文件 created 没有帮助。这是我的 [REVISED] app.config:
<?xml version="1.0" encoding="utf-8" ?>
<!-- IMPORTANT! To run this on your local machine, first follow instructions in http://support2.microsoft.com/kb/2785590 -->
<!-- You will run into tcp listen errors otherwise -->
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<services>
<service name="SettingsDB.Configuration" behaviorConfiguration="DefaultBehavior">
<endpoint binding="netTcpBinding" bindingConfiguration="max" contract="SettingsDB.IConfiguration" address="Settings" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9000/SettingsService" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="max" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2147483647" maxReceivedMessageSize="2147483647" listenBacklog="2147483647" transactionFlow="false" portSharingEnabled="true">
<readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" />
<reliableSession enabled="false" />
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<serviceMetadata httpGetEnabled="false" httpGetUrl="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
<system.web>
<compilation debug="true" />
</system.web>
<runtime>
<gcServer enabled="true" />
</runtime>
</configuration>
【问题讨论】: