tags:

views:

212

answers:

5

Let's say I have my TFS team project setup the way I want it, and all the code between my machine and the team project is in sync (i.e. if I do a get latest it says everything is up to date).

What I would like to do is test whether or not I can pull the project back down to my local machine from TFS source control have everything work properly. By work properly, I mean I'm able to build all the projects, run the web sites, etc.

I thought what I could do is just blow away the code on my local machine and then do a get latest. But TFS seems to think that my local machine and TFS are still in sync (this is a bit different from the way Visual Source Safe worked).

In a nutshell, I'm just trying to test whether or not if another developer were to pull this team project down to their machine, that I know the project is setup correctly with all the necessary dependencies, etc. such that the other developer could build and run the project. But since I only have one machine to test this with currently, I need to do this test on the same machine.

The only way I've found to do it is to use "Get specific version" and force it to overwrite existing files, but it seems like if I delete the stuff off my hard drive, it should know when I do a get latest that "hey, the files aren't there anymore, I need to pull them down".

Any ideas on how I can do this? Thanks.

A: 

Do Get Specific Version and specify the latest. This will force TFS to download everything, ignoring the current synchronisation status.

ck
Right, I discovered the "Get Specific Version" method already as noted in my question. But thanks for your answer. I suppose it may be the only way.
dcp
@dcp - sorry, I got a bit eager with my answer and missed the end of the question... I think Get Specific Version will be your only choice, and isn't too much of an overhead.
ck
+2  A: 

TFS is a little different that VSS in that local workspaces are maintained so that every file doesn't have to be compared with every GET. In addition to removing the code from your development machine, you should also delete your local workspace. Check out "Working with Version Control Workspaces" on MSDN:

http://msdn.microsoft.com/en-us/library/ms181383.aspx

Really, though, the best way to make sure that your code can be pulled down and built easily is to create an automated build in TFS for continuous integration. That way you know immediately if you have done something that would make the solution un-buildable.

Check out the overviews of Team Foundation Build on MSDN:

http://msdn.microsoft.com/en-us/library/ms181710.aspx

mkedobbs
A: 

TFS uses your workspace to know what is synched between the server and local.

I don't think there is an option to make Get Latest to behave like you want (Get Specific Version and specifying Latest Version and Overwrite).

Breandán
+2  A: 

Not withstanding the answer above highlighting the merits of having an automated build process and continuous integration...

The easiest way to validate what you've checked-in is to create a new workspace with the same folder mappings, albeit to a different location on your hard-drive. You can then 'Get Latest' into this new workspace and confirm that everything builds locally, this should prove that:

  1. The correct versions of existing files are in source control
  2. All the required files have actually been added to source control

Alternatively if you'd rather not check-in your changes until you've validated your pending changes, then your best bet is to 'Shelve' all your changes (ticking the box to undo your pending changes), and then 'Unshelve' that shelveset into a new Workspace and do your testing against that instance of the codebase... or even ask a colleague to pull down your shelveset and do the validation (typically this called a 'Buddy Build').

JamesD
Thanks, I will try the new workspace method to test it.
dcp
+1  A: 

The answers above are good. Except it will not completely test you entire scenario. If you have references outside of your solution (such as dll in the GAC, or dll from an SDK installed on your machine), creating a new workspace or deleting and getting latest code won't found those problems.

The only way to make sure is to pull down the code on another computer. If you don't have another computer handy, you can use a Virtual machine.

joerage