Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get latest from a Visual Studio solution from the command line?

How do I get the latest version of my solution recursively like its done in the solution explorer context menu of Visual Studio? I want to do this from the command line or via a macro. I'm trying to automate a part of my daily routine by using a set of batch files. I am sure a lot of developers would love to have something like this.

tf get only gets contents of a folder recursively (not solution). It does not look at project dependencies and so on. That won't work.

like image 701
Agnel Kurian Avatar asked Aug 29 '08 08:08

Agnel Kurian


People also ask

How do I open a Visual Studio solution from the command line?

start MySolution/MySolution. sln and hit Enter . This will open whatever version of Visual Studio you currently have set to open with . sln files in Windows.

How do I use Visual Studio commands?

The Command window is used to execute commands or aliases directly in the Visual Studio integrated development environment (IDE). You can execute both menu commands and commands that do not appear on any menu. To display the Command window, choose Other Windows from the View menu, and select Command Window.

How do I compile a solution from the command line?

To build a specific target of a specific project in a solution. At the command line, type MSBuild.exe <SolutionName>. sln , where <SolutionName> corresponds to the file name of the solution that contains the target that you want to execute.


1 Answers

TFS has a .Net SDK that allows you to create your own custom programs that interact with a TFS Server. You could write a small program that performs the task you need:

TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("MyServer");
VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));

WorkSpace[] myWorkSpaces = vcs.QueryWorkSpaces("MyWorkSpaceName", "MyLoginName", "MyComputer");

myWorkSpaces[0].Get(VersionSpec.Latest, GetOptions.GetAll);
like image 196
tbreffni Avatar answered Oct 15 '22 23:10

tbreffni