当前位置:编程学习 > C#/ASP.NET >>

在iis上部署net.tcp类型wcf服务出错

服务器App.config中service如下:
<service behaviorConfiguration="DefaultBehavior" name="ICSS.Plover.WCFServiceHost.AuthenticService">
        <endpoint binding="netTcpBinding" bindingConfiguration="NetTcpBinding_Config"
          contract="ICSS.Plover.WCFServiceHost.IAuthenticService" />
        <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <!--<add baseAddress="http://localhost:8012/AuthenticService" />-->
            <add baseAddress="net.tcp://localhost:8013/AuthenticService" />
          </baseAddresses>
        </host>
      </service>
netTcpBinding如下:
<bindings>
      <netTcpBinding>
        <binding name="NetTcpBinding_Config" maxReceivedMessageSize="2147483647" closeTimeout="01:00:00"
                 openTimeout="01:00:00" receiveTimeout="01:00:00" sendTimeout="01:00:00" transactionFlow="false"
                 transferMode="Buffered" transactionProtocol="OleTransactions"
                 hostNameComparisonMode="StrongWildcard" listenBacklog="200" maxBufferPoolSize="524288"
                 maxConnections="200" >
          <readerQuotas maxStringContentLength="2147483647" maxArrayLength="163840000" />
          <reliableSession enabled="true" inactivityTimeout="23:59:59" />
          
          <security mode="None"></security>
        </binding>
      </netTcpBinding>
    </bindings>
iis绑定如下:


进入服务报错如下:
未找到 URI“net.tcp://localhost:8013/ICSS.Plover.WCFServiceHost.AuthenticService.svc”的兼容 TransportManager。这可能是因为使用了指向虚拟应用程序外部的绝对地址,或终结点的绑定设置与已由其他服务或终结点设置的绑定设置不匹配。请注意,同一协议的所有绑定在同一应用程序中应具有相同的设置。

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.InvalidOperationException: 未找到 URI“net.tcp://localhost:8013/ICSS.Plover.WCFServiceHost.AuthenticService.svc”的兼容 TransportManager。这可能是因为使用了指向虚拟应用程序外部的绝对地址,或终结点的绑定设置与已由其他服务或终结点设置的绑定设置不匹配。请注意,同一协议的所有绑定在同一应用程序中应具有相同的设置。

源错误: 

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪: 


[InvalidOperationException: 未找到 URI“net.tcp://localhost:8013/ICSS.Plover.WCFServiceHost.AuthenticService.svc”的兼容 TransportManager。这可能是因为使用了指向虚拟应用程序外部的绝对地址,或终结点的绑定设置与已由其他服务或终结点设置的绑定设置不匹配。请注意,同一协议的所有绑定在同一应用程序中应具有相同的设置。]
   System.ServiceModel.Channels.TransportChannelListener.ThrowTransportManagersNotFound() +480
   System.ServiceModel.Channels.TransportChannelListener.SelectTransportManagers() +11481055
   System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback) +66
   System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout) +63
   System.ServiceModel.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan timeout) +56
   System.ServiceModel.Channels.TcpChannelListener`2.OnOpen(TimeSpan timeout) +67
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.Channels.ReliableChannelListenerBase`1.OnOpen(TimeSpan timeout) +106
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.Channels.LayeredChannelListener`1.OnOpen(TimeSpan timeout) +51
   System.ServiceModel.Channels.DelegatingChannelListener`1.OnOpen(TimeSpan timeout) +67
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +72

[InvalidOperationException: “net.tcp://localhost:8013/ICSS.Plover.WCFServiceHost.AuthenticService.svc”处带有协定“"IAuthenticService"”的 ChannelDispatcher 无法打开其 IchannelListener。]
   System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +118
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +107
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

[ServiceActivationException: 由于编译过程中出现异常,无法激活服务“/ICSS.Plover.WCFServiceHost.AuthenticService.svc”。异常消息为: “net.tcp://localhost:8013/ICSS.Plover.WCFServiceHost.AuthenticService.svc”处带有协定“"IAuthenticService"”的 ChannelDispatcher 无法打开其 IchannelListener。。]
   System.ServiceModel.AsyncResult.End(IAsyncResult result) +11592858
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
   System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +275
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

求大神帮忙啊! --------------------编程问答-------------------- 哪位大侠帮帮忙啊 --------------------编程问答-------------------- 楼主头像很可爱
--------------------编程问答-------------------- 怎么没人呢? --------------------编程问答-------------------- 有大神在吗? --------------------编程问答-------------------- --------------------编程问答-------------------- 看一下能解决么?
http://wengyuli.blog.51cto.com/44136/586564 --------------------编程问答--------------------
引用 6 楼 aixiuhua 的回复:
看一下能解决么? http://wengyuli.blog.51cto.com/44136/586564

我这的是cs的项目,建的是WCF服务库的项目,没有那个web选项啊



--------------------编程问答-------------------- 你的web.config文件呢?iis下面不用app.config,而是用web.config,虽然基本格式一样。 --------------------编程问答--------------------
引用 8 楼 qldsrx 的回复:
你的web.config文件呢?iis下面不用app.config,而是用web.config,虽然基本格式一样。

把这项目发布之后会生成一个基本一样的web.config. --------------------编程问答-------------------- 把你的<host>标签删掉,那个虽然不清楚是如何作用的,但是在IIS里面,地址是由你设定的虚拟路径地址决定的,可能会被那个<host>设置给覆盖(或冲突) --------------------编程问答-------------------- 还真没在IIS中用过netTcpBinding.

看看下面两篇文章有没有帮助:
Hosting in IIS using NetTcpBinding
http://blogs.msdn.com/b/james_osbornes_blog/archive/2010/12/07/hosting-in-iis-using-nettcpbinding.aspx

HowTo: netTcpBinding on IIS and things to remember
http://blogs.msdn.com/b/santhoshonline/archive/2010/07/01/howto-nettcpbinding-on-iis-and-things-to-remember.aspx --------------------编程问答-------------------- 我也觉得 <host>没什么用处。 --------------------编程问答-------------------- 哥们,问题解决没有。我也遇到这个问题,我是把在Binding里面的maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10"
                maxReceivedMessageSize="2147483647" 这几个节点删了就好了 --------------------编程问答-------------------- 我都放弃了,等明天再试试~谢谢 --------------------编程问答-------------------- 你确定IIS 能支持双向连接?

原来找了很久都没试成功过。基本上都采用Window服务加载WCF实现双向 --------------------编程问答-------------------- 好,LZ!我遇到相同的问题,如果解决了,通知一下,谢谢了! 
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,