title: using TFS API how can I get the changeset ID for a file on a specific date?
body: <p>I was hoping that I could pass a <code>DateVersionSpec</code> into <code>VersionControlServer.DownloadFile()</code> but it doesn't work. It tells me that the item doesn't exist at that version, even though the file existed in source on the date passed. </p>
  
  <p>Do I need to query the Item history just so I can figure out what version the file was at on the date in question? Use <code>QueryHistory(...)</code> method? </p>
  
  <p>My current code: </p>
  
  <pre><code>version = new DateVersionSpec(date);
  var changeSets = this.vcServer.QueryHistory(remoteFile, VersionSpec.Latest, 0,      
      RecursionType.None, user, version, version, 50, true, false);
  if (changeSets == null) 
  {
  throw new Exception("Failed to find..."); 
  }
  
  foreach (var item in changeSets)
   {
  
   }
  </code></pre>
  
  <p>Currently I'm not getting anything back when I pull the changeSets enumerable. </p>
  
  <p>I'm using code that's a lot like this: <a href="http://blogs.microsoft.co.il/blogs/srlteam/archive/2009/06/14/how-to-get-a-file-history-in-tfs-source-control-using-code.aspx" rel="nofollow noreferrer">http://blogs.microsoft.co.il/blogs/srlteam/archive/2009/06/14/how-to-get-a-file-history-in-tfs-source-control-using-code.aspx</a></p>
  
  <p>Update: the code that I have is pretty close (practically identical to the code from the post) but it dies if the file was added on a date before the date passed in and hasn't been changed since i.e. it only has one change and that's an add. </p>