【发布时间】:2015-06-24 15:28:30
【问题描述】:
我正在尝试将服务引用添加到已经有其他引用的项目。我已经复制了这些项目中使用的 App.Config 和 Web.config,并将它们调整为我想要添加的服务。我还复制并修改了合同,我相信我做得很好。
所以我的问题是:您认为我在添加服务引用时可能犯了哪些错误或常见错误,或者同样有帮助,我可以在哪里以及如何解决有关添加服务错误的问题引用带有 mex 端点的项目?
错误
错误详情
附加信息:
合约只作为一个操作(“开始”)。
正在通过 net.tcp 建立连接。
Service 和 Object 是不同的项目。
对象有一个 App.Config,服务有一个 Web.Config
更新
服务 Web.Config
<?xml version="1.0"?>
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\inetpub\SocketListener\logs\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5.1" />
</system.web>
<system.serviceModel>
<services>
<service name="SocketListener.SocketListener">
<endpoint address="" binding="netTcpBinding" contract="SocketListener.ISocketListener">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://<IP>/SocketListener/SocketListener.svc" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="netTcpBindingConf" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:05:00" hostNameComparisonMode="StrongWildcard" transactionFlow="false" transferMode="Buffered" maxBufferPoolSize="20000000"
maxBufferSize="20000000"
maxConnections="20000000"
maxReceivedMessageSize="20000000"
portSharingEnabled="true"
listenBacklog="20000000">
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200" maxConcurrentInstances="200" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
</startup>
</configuration>
【问题讨论】:
-
显示服务配置
-
嗨@burning_LEGION,感谢您的建议