2012-11-22 165 views
0

我正在改变我的wcf托管从Windows服务托管在IIS中。协议'net.tcp'不受支持。

我在溶液WCF服务机应用已经添加和我已经加入参考我的项目和编辑的SVC文件到此

然后我已经配置的web.config和绑定定义将被netTcp结合和终点。

我已启用我的IIS网站设置为http.nettcp启用协议和相同的异常。

我有一个得到这个例外在浏览我的service.svc文件,我需要帮助来克服它

这里是抗辩:

**protocol 'net.tcp' is not supported. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.InvalidOperationException: The protocol 'net.tcp' is not supported. 
Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
Stack Trace: 
[InvalidOperationException: The protocol 'net.tcp' is not supported.] 
    System.ServiceModel.Activation.HostedTransportConfigurationManager.InternalGetConfiguration(String scheme) +98668 
    System.ServiceModel.Activation.HostedAspNetEnvironment.GetBaseUri(String transportScheme, Uri listenUri) +24 
    System.ServiceModel.Channels.TransportChannelListener.OnOpening() +12200164 
    System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +274 
    System.ServiceModel.Channels.DelegatingChannelListener`1.OnOpen(TimeSpan timeout) +112 
    System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +318 
    System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +72** 

,这里是我的Web.config文件

<?xml version="1.0"?> 
<configuration> 

    <system.web> 
    <compilation debug="false" targetFramework="4.0" /> 
    </system.web> 

    <system.serviceModel> 
    <bindings> 
     <netTcpBinding> 
     <binding name="NetTcpBinding" 
       transactionFlow="true" 
       listenBacklog="100" 
       maxConnections="5000"/> 
     </netTcpBinding> 
    </bindings> 
    <services> 
     <service name="EFG.Acc.CashService.ServiceFactory.CashService"> 
     <endpoint address="net.tcp://localhost:8000" binding="netTcpBinding" 
      bindingConfiguration="NetTcpBinding" name="netTcpEndPoint" bindingName="CashServiceTCP" 
      contract="EFG.Acc.CashService.Contracts.Interfaces.ICashService" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:7000"/> 

      </baseAddresses> 
     </host> 

     </service> 
    </services> 
    <protocolMapping> 
     <add scheme="net.tcp" binding="netTcpBinding" bindingConfiguration="NetTcpBinding"/> 
    </protocolMapping> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!--To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment--> 
      <serviceMetadata httpGetEnabled="true"/> 
      <!--To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information--> 
      <serviceDebug includeExceptionDetailInFaults="false"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <client> 
     <endpoint address="net.tcp://localhost:8000/CashService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding" contract="EFG.Acc.CashService.Contracts.Interfaces.ICashService" name="CashServiceTCP2" /> 
    </client> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 

    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 

</configuration> 

回答