3

I have 8 vms, each having the product code. I've created an application using which I can trigger a codedui automation run remotely using mstest. Now the problem is, everytime I have to copy and paste the latest dlls on all the 8 vms to run the recently updated code and the transfering files from local machine to vm takes like eternity to copy over the network.

Is there a way by which I can create a batchfile using which I can download the latest code from the tfs server and then build my codedui test code on each of the VMs?

I know tf get and msbuild can be used for this but I do not know how to use it correctly as getting latest from the server would result in conflicts which needs to be resolved first before building the solution.

Is there a way to replace the entire solution using command line while performing get operation?

Is there a better approach to solve my problem.

Thanks!

vivek singh
  • 121
  • 1
  • 18
  • Documentation on the tf.exe GET command: https://msdn.microsoft.com/en-us/library/fx7sdeyf(v=vs.100).aspx – user469104 Mar 23 '16 at 13:01
  • How many MB/GB are the compiled DLLs? How many DLLs? Do all the DLLs change every time or usually only a few? Are all the DLLs the same size or are there a few big ones and the rest small? – chief7 Mar 23 '16 at 14:11
  • Mainly there's just one dll. But there are xml files also which gets added so getting latest from tfs is a must. If there're major changes then 3-4 dlls get hit. – vivek singh Mar 23 '16 at 14:22
  • Was Mikael's or my answer helpful to you? Did you end up with a solution? – PerryC Mar 29 '16 at 14:57
  • I haven't tried it out still coz I was a bit away from my laptop. Will let you guys know tomorrow once I try implementing them. Thanks for all the answers. I'll let you know soon. – vivek singh Mar 29 '16 at 15:03

2 Answers2

1

If you want to replace the entire solution and build from scratch I suggest you just delete the folder and then get it:

   rd /s MySolutionFolder
   tf get MySolutionFolder

But, this will of course take some time.

Unless you're editing files on the VM, tf get should not trigger any conflicts. If you are editing files, you can use a combination of tf get and tf resolve to deal with those issues. You could use something like this to ignore any conflicts and take the server version.

 tf get MySolutionFolder /recursive /noprompt
 tf resolve /auto:taketheirs
Mikael Nitell
  • 1,069
  • 6
  • 16
0

You could also use Team Foundation Power Tools (link to tfpt). It's a very useful little utility =). Specificially, if you want to make sure your workspace is identical to TFS, you could use:

tfpt scorch /diff /deletes /recursive /noprompt

You probably don't need /diff unless you want to check the MD5 diff instead of just the read-only bit (this might also depend on server/local workspaces). The /recursive might not do anything in this case as well, because you didn't specify a root folder. That's okay because I think you want to apply this to the entire workspace.

I'm fairly sure you would have to call this from a Visual Studio Dev Prompt. You could add a line to your batch file like:

call "C:\Program Files\Microsoft Visual Studio 2008\VC\vcvarsall.bat" x86_amd64

See this SO post on that: How to create a Batch File for Visual Studio Command Prompt

Mikael's post is also a good answer as my answer doesn't help with resolving conflicts. My answer is more along the lines of wiping everything away and restoring it (as needed).

Community
  • 1
  • 1
PerryC
  • 1,233
  • 2
  • 12
  • 28
  • Just had one question in mind, if i have to just replace those files which have been changed from those in the server version. Can that be done using tfpt? – vivek singh Mar 31 '16 at 08:05
  • I would look at the `tfpt treeclean`, `tfpt scorch` (as mentioned in my answer), and `tfpt uu` Team Foundation Power Tool commands and see which one fits your needs best. My best guess is that `tfpt uu` might be what you're looking for if scorch/treeclean are too heavy-weight. – PerryC Mar 31 '16 at 14:11
  • Thanks Again for the answer Perry! It really helped!! – vivek singh Apr 04 '16 at 06:36