# Team Foundation Latest Version Number - Wrong changeset id?

**URL:** <https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630>\
**Category:** Discussion\
**Created:** [October 29, 2010, 8:58am UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630 "2010-10-29T08:58:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![andre.johansson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@andre.johansson](https://www.finalbuilder.com/forums/u/andre.johansson)\
**Post date:** [October 29, 2010, 8:58am UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630/1 "2010-10-29T08:58:31Z")

</div>

&nbsp;Hello,

I am trying to get the latest changeset id for one of my projects using the "Team Foundation Latest Version Number" action. However I keep getting the latest changeset id for for the whole server.&nbsp;

This is how I have set up the taks:

**1. Map tfs working folder**

servername is set to my tfs server (http:tfs:8080)

workspace is set (ixxtfs2)

and remote folder is set to my project $/CAR001

local working folder:&nbsp;%SrcDir%

**2. Team foundation latest version number**

Working folder: I have tried both "use default" and user %SrcDir% but I get no difference.

The command r **eturns changeset id 1571** which is the latest for $/, but **I want the latest for $/CAR001 which is 1554.**

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)\
**Post date:** [October 31, 2010, 10:41am UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630/2 "2010-10-31T10:41:32Z")

</div>

&nbsp;Hi Andre,

We use the [tf changeset](http://msdn.microsoft.com/en-us/library/w51xa47k(VS.80).aspx)&nbsp;command to get the version number - from my reading of the docs and some brief testing it doesn't appear to support filtering at the project level. The [tf history](http://msdn.microsoft.com/en-us/library/yxtbh4yh(v=VS.80).aspx)&nbsp;command does seem to be project-aware, but its output is less deterministic and is hence harder to parse to extract the version number. If I can reliably parse the history output, I'll change the action to use it.

Cheers,

Ben

---

<div class="post-metadata">

**Author:** ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)\
**Post date:** [November 1, 2010, 12:02pm UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630/3 "2010-11-01T12:02:39Z")

</div>

Hi again Andre,   
 I’ve changed the action to use tf history in the latest test build: [https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700\_812.exe](https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_812.exe)   
  
 Can you please download it and see if it addresses your issue?   
  
 Cheers,   
  
 Ben

---

<div class="post-metadata">

**Author:** ![andre.johansson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@andre.johansson](https://www.finalbuilder.com/forums/u/andre.johansson)\
**Post date:** [November 1, 2010, 7:59am UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630/4 "2010-11-01T07:59:38Z")

</div>

&nbsp;Hello again,

First of all, I'm impressed and pleased with the fast response, thank you!

Unfortunatly I can't get it right just yet, the command executed by the get latest version number is "history \* /recursive /noprompt". This command fails on my machine. However "history $/CAR001 /recursive /noprompt" does not, but I can't find any setting to change the parameters.

&nbsp;

See the attached picture.

&nbsp;

[Attachment unavailable]\</span

---

<div class="post-metadata">

**Author:** ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)\
**Post date:** [November 1, 2010, 9:38am UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630/5 "2010-11-01T09:38:40Z")

</div>

Hi Andre,   
 I tested with the 2010 version of tf.exe, and it looks like you’re using 2008. There may have been a change between 2008 and 2010. What output do you get if you manually run tf.exe /history \* /noprompt /recursive from the command line in your src directory?   
  
 Cheers,   
 Ben

---

<div class="post-metadata">

**Author:** ![andre.johansson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@andre.johansson](https://www.finalbuilder.com/forums/u/andre.johansson)\
**Post date:** [November 2, 2010, 7:27am UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630/6 "2010-11-02T07:27:15Z")

</div>

Hello again,

It seems like I have some other error, but I can't really figure out what (I'm not the best friend with TFS). The tf command seems to look for a workspace called "Ixxtfs2"&nbsp;(like the computer name). Even if the only existing workspace is Nova-Release which is mapped to the correct source folder.

![003_002_001_Capture.PNG.jpg](https://www.finalbuilder.com/forums/uploads/default/original/2X/a/a6f1a441324bf906b20e21f12084b77e06a72af3.jpeg)

---

<div class="post-metadata">

**Author:** ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)\
**Post date:** [November 2, 2010, 10:24am UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630/7 "2010-11-02T10:24:06Z")

</div>

Hi Andre,   
 Unfortunately the forum software has re-sized your image and I can’t read the command output. Can you please either add a screenshot of just the CMD window, or cut and paste the text?   
  
 FYI in your first post you said you had set the workspace to ixxtfs2.   
  
 Ben

---

<div class="post-metadata">

**Author:** ![andre.johansson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@andre.johansson](https://www.finalbuilder.com/forums/u/andre.johansson)\
**Post date:** [November 3, 2010, 7:29am UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630/8 "2010-11-03T07:29:25Z")

</div>

Here it goes again...sorry.

Yes, previsouly I had IXXTFS2 as a default workspace set up on the machine. But I had to change it so now I create a workspace in my build script (Productname-Buildtype) and delete it when I'm done.

I hope this picture is a bit clearer, otherwise here is the output:

Here is the command:&nbsp;d:\BuildServerWorkDir\NOVA-Release\src\>tf history \*&nbsp;/noprompt /recursive"

Output:&nbsp;"TF14061:&nbsp;The workspace IXXTFS2;IXX\andrej.admin does not exist"

Notice that in the dialog behind, you can see that there is no workspace ixxtfs2 anymore so why tfs searches for it is a mystery for me.

![Capture2.PNG.jpg](https://www.finalbuilder.com/forums/uploads/default/original/2X/5/579aee91bce20de22b28bb71bc041730f5ad186a.jpeg)

---

<div class="post-metadata">

**Author:** ![andre.johansson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@andre.johansson](https://www.finalbuilder.com/forums/u/andre.johansson)\
**Post date:** [November 3, 2010, 8:47am UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630/9 "2010-11-03T08:47:26Z")

</div>

I don't know exactly what I've done but after some restarting and using your latest build the build numbers now seem correct. If i figure out what was wrong I will post it here.

&nbsp;

But thanks for you help and the extra build!

---

<div class="post-metadata">

**Author:** ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)\
**Post date:** [November 3, 2010, 9:58am UTC](https://www.finalbuilder.com/forums/t/team-foundation-latest-version-number-wrong-changeset-id/1630/10 "2010-11-03T09:58:37Z")

</div>

Glad it’s working now. Please let us know if you run into any more issues.   
  
 Cheers,   
  
 Ben
