C# 在WCF 4.X中配置netTcpBinding的正确方法是什么
我正在开发一个WCF应用程序,其绑定必须是“netTcpBinding”,但当我在Visual Studio 2013中运行该应用程序时,会出现以下错误:“无法获取元数据http://localhost:62081/Queue.svc”。我和他一样仔细地搜寻,但没有找到一个工作的例子。我想了解这是如何工作的。谢谢您将在下面找到我的web配置:C# 在WCF 4.X中配置netTcpBinding的正确方法是什么,c#,wcf,visual-studio-2013,wcf-binding,nettcpbinding,C#,Wcf,Visual Studio 2013,Wcf Binding,Nettcpbinding,我正在开发一个WCF应用程序,其绑定必须是“netTcpBinding”,但当我在Visual Studio 2013中运行该应用程序时,会出现以下错误:“无法获取元数据http://localhost:62081/Queue.svc”。我和他一样仔细地搜寻,但没有找到一个工作的例子。我想了解这是如何工作的。谢谢您将在下面找到我的web配置: <?xml version="1.0" encoding="utf-8"?> <configuration> <appSe
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="QueueBehavior">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="QueueBehavior" name="ComponenteCola.Queue">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
name="QueueNetTcpEndPoint" contract="ComponenteCola.IQueue" />
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
name="NetTcpMetadataPoint" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:57965/Queue" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
希望仍然有帮助
我认为它需要实际的元数据URL,尝试这样添加
<baseAddresses>
<add baseAddress="net.tcp://localhost:57965/Queue" />
<add baseAddress="http://localhost:62081/Queue/mex" />
</baseAddresses>
我正在使用.NET4的自托管WCF服务,但我认为不会有太多差异
嗯