Automate "Add solution to Source control"

Hello,

i have an Addin that creates a new solution and adds the currently selected project to it and then creates a new test project. Now i want this newly created solution (and newly created test project) added to source control. The folder in which the solution and new test project reside are in an mapped TFS folder.

What is the best way to deal with this, i tried to use the automation model

DTE.ExecuteCommand("File.AddSolutionToSourceControl", "");But this doesnt work it returns the following exception "[System.Runtime.InteropServices.COMException] {"Error HRESULT E_FAIL has been returned from a call to a COM component."} ". I suspect i might have to supply aditional parameters but i have no idea what they should be? Anyone?

Alternatively i think it can be done by using the TFS object model, but i have no idea where to start, any help is appreciated!

Preferably i would like to use theDTE.ExecuteCommand("File.AddSolutionToSourceControl", "");..

[1317 byte] By [PaulPaschedag] at [2008-2-22]
# 1

For various reasons, most of the TFS SCC DTE commands have a "Tfs" prefix. In this case, File.TfsAddSolutionToSourceControl should do the trick.

--Ben

BenRyan at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Work Item Tracking...

Visual Studio Team System

Site Classified