title: ClickOnce Hello World not working
body: <p>I read some documentation about how to do ClickOnce deployment and now I'm trying to deploy a hello world application.</p>
  
  <p>I have a WPF default application (just an empty window).</p>
  
  <p>This is what I do:</p>
  
  <ul>
  <li>Open project properties.</li>
  <li>Open publish wizard.</li>
  <li>Select a local server. I created a website using Visual Studio (File/New/WebSite) and then I can select it from the list. I used the one named <strong>Test1</strong>.</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/UzZlL.png" alt="local server"></p>
  
  <ul>
  <li>Then select the option that says <em>The application will be available online and offline</em></li>
  <li>Publish</li>
  <li>Now I run the ISS Express server and go to <code>http://localhost:6507/publish.htm</code> that look like this:</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/beJWs.png" alt="publish page"></p>
  
  <ul>
  <li>I hit the publish button and download <strong>setup.exe</strong>.</li>
  <li>But when I start <strong>setup.exe</strong> I get the following error:</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/LYRz0.png" alt="error msg"></p>
  
  <ul>
  <li><p>And the log is:</p>
  
  <pre><code>The following properties have been set:
  Property: [AdminUser] = true {boolean}
  Property: [InstallMode] = HomeSite {string}
  Property: [NTProductType] = 1 {int}
  Property: [ProcessorArchitecture] = AMD64 {string}
  Property: [VersionNT] = 6.2.0 {version}
  Running checks for package 'Microsoft .NET Framework 4.5 (x86 and x64)', phase BuildList
  Reading value 'Version' of registry key 'HKLM\Software\Microsoft\NET Framework    Setup\NDP\v4\Full'
  Read string value '4.5.50938'
  Setting value '4.5.50938 {string}' for property 'DotNet45Full_TargetVersion'
  The following properties have been set for package 'Microsoft .NET Framework 4.5 (x86 and x64)':
  Property: [DotNet45Full_TargetVersion] = 4.5.50938 {string}
  Running checks for command 'DotNetFX45\dotNetFx45_Full_x86_x64.exe'
  Result of running operator 'ValueEqualTo' on property 'InstallMode' and value 'HomeSite': true
  Result of checks for command 'DotNetFX45\dotNetFx45_Full_x86_x64.exe' is 'Bypass'
  Running checks for command 'DotNetFX45\dotNetFx45_Full_setup.exe'
  Result of running operator 'ValueNotEqualTo' on property 'InstallMode' and value 'HomeSite': false
  Result of running operator 'VersionGreaterThanOrEqualTo' on property 'DotNet45Full_TargetVersion' and value '4.5.50709': true
  Result of checks for command 'DotNetFX45\dotNetFx45_Full_setup.exe' is 'Bypass'
  'Microsoft .NET Framework 4.5 (x86 and x64)' RunCheck result: No Install Needed
  Launching Application.
  URLDownloadToCacheFile failed with HRESULT '-2146697208'
  Error: An error occurred trying to download     `http://agarwaen-pc:6507/WpfApplication1.application`.
  </code></pre></li>
  </ul>
  
  <p>I'm stuck with this because its a Hello World example and is not working. I need to deploy a project that is far more complex.
  Any help will be appreciated.
  Thanks in advance.</p>
  
  <p><strong>PD: I'm thinking that the reason of the error may be the server that I'm using. I mean that I just point to a project that has the publish page and then right click <em>Show in browser</em> to start the ISS server. Maybe the setup program cannot download the required files because the server isn't serving those.</strong></p>
  
  <p><strong>EDIT:</strong>
  I moved to not Express version of ISS and the <strong>setup.exe</strong> file now downloads successfully. Now I get another download error when the application is trying to download the remaining files. The message says <strong>No connection could be made because the target machine actively refused it</strong></p>
  
  <p>The message is:</p>
  
  <pre><code>PLATFORM VERSION INFO
      Windows             : 6.2.9200.0 (Win32NT)
      Common Language Runtime     : 4.0.30319.18408
      System.Deployment.dll       : 4.0.30319.17929 built by: FX45RTMREL
      clr.dll             : 4.0.30319.18408 built by: FX451RTMGREL
      dfdll.dll           : 4.0.30319.17929 built by: FX45RTMREL
      dfshim.dll          : 4.0.41209.0 (Main.041209-0000)
  
  SOURCES
      Deployment url          : http://agarwaen-pc/WpfApplication1.application
                          Server      : Microsoft-IIS/8.0
      Deployment Provider url     : http://agarwaen-pc:6507/WpfApplication1.application
  
  ERROR SUMMARY
      Below is a summary of the errors, details of these errors are listed later in the log.
      * Activation of http://agarwaen-pc/WpfApplication1.application resulted in exception. Following failure messages were detected:
          + Downloading http://agarwaen-pc:6507/WpfApplication1.application did not succeed.
          + Unable to connect to the remote server
          + No connection could be made because the target machine actively refused it 10.6.53.219:6507
  
  COMPONENT STORE TRANSACTION FAILURE SUMMARY
      No transaction error was detected.
  
  WARNINGS
      There were no warnings during this operation.
  
  OPERATION PROGRESS STATUS
      * [4/25/2014 12:15:27 AM] : Activation of http://agarwaen-pc/WpfApplication1.application has started.
  
  ERROR DETAILS
      Following errors were detected during this operation.
      * [4/25/2014 12:15:33 AM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
          - Downloading http://agarwaen-pc:6507/WpfApplication1.application 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.DownloadManifestAsRawFile(Uri&amp; sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation&amp; serverInformation)
              at System.Deployment.Application.DownloadManager.DownloadManifest(Uri&amp; sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ManifestType manifestType, ServerInformation&amp; serverInformation)
              at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri&amp; sourceUri, TempFile&amp; tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation&amp; serverInformation)
              at System.Deployment.Application.DownloadManager.FollowDeploymentProviderUri(SubscriptionStore subStore, AssemblyManifest&amp; deployment, Uri&amp; sourceUri, TempFile&amp; tempFile, IDownloadNotification notification, DownloadOptions options)
              at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri&amp; sourceUri, TempFile&amp; tempFile, SubscriptionState&amp; subState, IDownloadNotification notification, DownloadOptions options)
              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.Net.WebException
          - Unable to connect to the remote server
          - Source: System
          - Stack trace:
              at System.Net.HttpWebRequest.GetResponse()
              at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
          --- Inner Exception ---
          System.Net.Sockets.SocketException
          - No connection could be made because the target machine actively refused it 10.6.53.219:6507
          - Source: System
          - Stack trace:
              at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
              at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket&amp; socket, IPAddress&amp; address, ConnectSocketState state, IAsyncResult asyncResult, Exception&amp; exception)
  
  COMPONENT STORE TRANSACTION DETAILS
      No transaction information is available.
  </code></pre>