title: ClickOnce error: An existing connection was forcibly closed by the remote host
body: <p>I have an annoying problem. I have application deployed by clickonce. Until now it was working really well and a lot of updates were deployed easilly. This time I had to do some major changes in my app. That causes update is about 16MB. Unfortunately most of time on clients computers error occurs during downloading update (in random moment): </p>
  
  <pre><code>ERROR SUMMARY
  Below is a summary of the errors, details of these errors are listed later in the log.
  * Activation of C:\Documents and Settings\Administrator\Menu Start\Programy\Marketell\Marketell.appref-ms| resulted in exception. Following failure messages were detected:
      + Downloading http://xx.xx.xx.xx/Marketell 2/Application Files/Marketell_1_0_1_2/CounterPathSDK.dll.deploy did not succeed.
      + Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
      + An existing connection was forcibly closed by the remote host
  </code></pre>
  
  <p>And some details:</p>
  
  <pre><code>ERROR DETAILS
  Following errors were detected during this operation.
  * [2011-11-28 14:02:34] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
      - Downloading http://xx.xx.xx.xx/Marketell 2/Application Files/Marketell_1_0_1_2/CounterPathSDK.dll.deploy did not succeed.
      - Source: System.Deployment
      - Stack trace:
          at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
          at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
          at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
          at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
          at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory&amp; downloadTemp)
          at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState&amp; subState, ActivationDescription actDesc)
          at System.Deployment.Application.ApplicationActivator.ConsumeUpdatedDeployment(SubscriptionState&amp; subState, ActivationDescription actDesc)
          at System.Deployment.Application.ApplicationActivator.PerformDeploymentUpdate(SubscriptionState&amp; subState, String&amp; errorPageUrl)
          at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, String&amp; errorPageUrl, TempFile&amp; deployFile)
          at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String&amp; errorPageUrl)
          at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
      --- Inner Exception ---
      System.IO.IOException
      - Unable to read data from the transport connection: Istniejące połączenie zostało gwałtownie zamknięte przez zdalnego hosta.
      - Source: System
      - Stack trace:
          at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)
          at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
      --- Inner Exception ---
      System.Net.Sockets.SocketException
      - Istniejące połączenie zostało gwałtownie zamknięte przez zdalnego hosta
      - Source: System
      - Stack trace:
          at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
          at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
  </code></pre>
  
  <p>Ofcourse I replaced real IP by Xs.<br>
  Only once it updated properly. I use WAMP as the HTTP server. 
  I've been Googling it for some time, but haven't found anything usefull acutally.</p>
  
  <p>Thanks</p>