2012-12-04 21 views
1

我通過服務總線公開我的Windows服務,下面是我的配置文件。 我得到奇怪的錯誤(所有突然它開始即將到來,雖然代碼/配置沒有變化,它之前工作正常WCF服務總線服務無法啓動配置錯誤「集合已包含相同類型的項目」

One23InsightService未能啓動異常消息: - 值無法添加到集合,因爲集合已經包含了一個相同類型的項:'Microsoft.ServiceBus.TransportClientEndpointBehavior'。這個集合只支持每種類型的一個實例。 參數名稱:item 我有兩個端點具有不同的接口,但具有相同的行爲配置。

<system.serviceModel> 
    <services> 
     <service name="One234C.Service.WCFNetTCPContract.InsightSrcDataService"> 
     <endpoint 
      name="SrcWeb" 
      address="sb://xxx.servicebus.windows.net/09C3FA14-D449-4EA0-A829-3B7BD06598C2" 
        binding="netTcpRelayBinding" 
        contract="One234C.Service.Interface.IOne23SrcService" 
        bindingConfiguration="Hybrid" 
        behaviorConfiguration="sbTokenProvider" /> 

     <endpoint 
      name="AdminServiceEndpoint" 
      address="sb://xxx.servicebus.windows.net/09C3FA14-D449-4EA0-A829-3B7BD06598C2" 
        binding="netTcpRelayBinding" 
        contract="One234C.Service.AdminInterface.IOne23AdminService" 
        bindingConfiguration="Hybrid" 
        behaviorConfiguration="sbTokenProvider" /> 
     </service> 
    </services> 
    <bindings> 
     <netTcpRelayBinding> 
     <binding name="Hybrid" connectionMode="Hybrid" maxReceivedMessageSize="500000"> 
      <security mode="None" /> 
     </binding> 
     </netTcpRelayBinding> 
    </bindings> 
    <behaviors> 

     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, 
      set the values below to false before deployment --> 
      <serviceMetadata httpGetEnabled="False" httpsGetEnabled="False" /> 
      <!-- 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> 
     <endpointBehaviors> 
     <behavior name="sbTokenProvider"> 
      <transportClientEndpointBehavior> 
      <tokenProvider> 
       <sharedSecret issuerName="owner" issuerSecret="asdfadfdfasdfasdfasdfsadfsadfsadfsdaf=" /> 
      </tokenProvider> 
      </transportClientEndpointBehavior> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
    <extensions> 
     <!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. --> 
     <behaviorExtensions> 
     <add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     </behaviorExtensions> 
     <bindingElementExtensions> 
     <add name="netMessagingTransport" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     </bindingElementExtensions> 
     <bindingExtensions> 
     <add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     </bindingExtensions> 
    </extensions> 
    </system.serviceModel> 
+0

那麼你是否嘗試創建一個新的行爲並將其分配給一個或其他端點? –

+0

@hugh是我也試過。它並沒有解決我的問題。我創建了這個安裝程序,它可能與註冊表損壞有關嗎? –

+0

它只與配置中的單個端點一起工作嗎? –

回答

0

我得到了修復,我給了兩個端點的相同地址,它必須有點不同,我糾正了,現在正在工作。