title: WebClient.DownloadProgressChanged never gets called
body: <p>I added an event handler to the WebClient's <code>DownloadProgressChanged</code> event, but it never seems to fire. The file successfully downloads, but without having its progress updated.</p>
  
  <pre><code>public class DownloadFile
  {
      private File file = null;
  
      public DownloadFile(File file)
      {
          this.file = file;
      }
  
      public void startDownloadThread()
      {
          Console.WriteLine("Starting Download : "+file.URL);
  
          var t = new Thread(() =&gt; DownloadThread(file));
          t.Start();
      }
  
      public Action&lt;string&gt; action_error_downloadFailed = Console.WriteLine;
      private void DownloadThread(File file) //Unnecessary argument but whatever ;D
      {
          try
          {
              string url = file.URL;
              string savepath = file.DestinationDir + "\\" + file.Filename;
  
              WebClient_B client = new WebClient_B();
              client.Proxy = null; //default to no proxy
              client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
              client.DownloadFile(url, savepath);
  
              Console.WriteLine("Download finished :" + file.Filename);
          }
          catch (Exception ex)
          {
              if (action_error_downloadFailed != null)
                  action_error_downloadFailed("Download failed :"+ex.Message);
          }
      }
  
      private void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
      {
          try
          {
              if (file.TotalSize == 0)
                  file.TotalSize = (int)e.TotalBytesToReceive;
              file.CurrentSize = (int)e.BytesReceived;
  
              Form_DownloadManager.rebuildQueue();
  
              Console.WriteLine("{0}    downloaded {1} of {2} bytes. {3} % complete...",
              (string)e.UserState,
              e.BytesReceived,
              e.TotalBytesToReceive,
              e.ProgressPercentage);
          }
          catch (Exception ex) { Console.WriteLine("client_DownloadProgressChanged error : "+ex.Message); }
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Starting Download : http://x.x.x/y/z.zip
  'projectname.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
  The thread '&lt;No Name&gt;' (0x3b8c) has exited with code 0 (0x0).
  Download finished :z.zip
  </code></pre>
  
  <p>I am using <code>WebClient_B</code> because I had to add useragent+cookiecontainer functionality to the <code>WebClient</code> class since my server kept rejecting the download request. The event never fired with the 'standard' <code>WebClient</code> class either, though. So that shouldn't be the problem. But anyway; <a href="http://codehelp.smartdev.eu/2009/05/08/improve-webclient-by-adding-useragent-and-cookies-to-your-requests/" rel="noreferrer">link to class</a></p>