2013-10-24 35 views
0

我有一個使用netTcpBinding,transferMode =「Streamed」的WCF服務,並通過installutil通過Windows進程激活服務方法進行安裝。該服務的構建和安裝很好。我對包含文件夾訪問.exe文件的網絡服務擁有所有正確的權利。我的問題是我不斷收到錯誤:Streamed Service - netTCPBinding - 服務構建,安裝但不會啓動

「本地計算機上的服務[服務名稱]已啓動,然後停止。如果某些服務沒有被其他服務或程序使用,則會自動停止。

奇怪的是主機安裝程序的代碼和緩衝服務是一樣的,運行得很好。在流媒體服務中,我會根據需要考慮傳遞流和消息。我被卡住了。我似乎無法找出爲什麼這項服務不能站起來。我檢查了端口,並且它們是開放的(沒有衝突)。有沒有人對'Streamed'netTcp服務沒有啓動建議?

下面是App.Config中的樣子:

<system.serviceModel> 
    <!--### Service Endpoints: ###--> 
    <!--Define Bindings--> 
    <bindings> 
     <netTcpBinding> 
     <binding name="netTcpStreamedBinding" closeTimeout="00:01:00" openTimeout="00:01:00" 
      receiveTimeout="00:20:00" sendTimeout="00:10:00" 
      transferMode="Streamed" maxBufferPoolSize="104857600" 
      maxReceivedMessageSize="1073741824" maxBufferSize="262144"> 

    <!-- Commented below out to match service that worked to see if this was error - It is not the problem (still no start) 
     <security mode="Transport"> 
      <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" /> 
      <message clientCredentialType="Windows" /> 
      </security>--> 

     </binding> 
     </netTcpBinding> 
    </bindings> 

     <!--Streamer Service--> 
    <services> 
     <service name="MyServiceLib.FileStreamer"> 
     <endpoint address="" binding="netTcpBinding" bindingConfiguration="netTcpStreamedBinding" contract="MyServiceLib.IFileStreamer"> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     <host> 
      <baseAddresses> 
      <add baseAddress="net.tcp://localhost:.../MyStreamerService"/> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 

    <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> 
    </behaviors> 

    </system.serviceModel> 
+0

需要考慮的一點是我在使用DirectorySecurity創建Put/Upload操作中的目錄。然而,類似的「緩衝」服務也是如此,並且開始就好。 –

回答

0

它的出現,甚至使用Visual Studio 2012我碰到了這個bug(最初發布的VS 2010):

Bug 571961 (marked as closed) - "Unable to Copy File"

此錯誤會引發「無法複製文件...,因爲它正在被另一個進程使用」錯誤。解決方法爲我工作 - 清理項目。關閉Visual Studio。重新打開VS.建立該項目。遵循這個過程允許我建立我的服務。

此外,在重複構建中,部分問題是需要在構建之前「停止」服務管理器中的服務。一定不要忘記這一點。

相關問題