DashRantic
DashRantic

Reputation: 1518

Get .sln file from Team Foundation Server SDK

I'm writing a check-in policy for Team Foundation Server, and would like to know if there's any way to get the path to the project solution's .sln file with the TFS SDK. Seems like there should be a way, just haven't found it yet--any help would be appreciated.

Upvotes: 0

Views: 1268

Answers (2)

DashRantic
DashRantic

Reputation: 1518

Found what I needed:


// Enumerate the checked pending changes.
PendingChange[] changes = m_pendingCheckin.PendingChanges.CheckedPendingChanges;

foreach ( PendingChange change in changes )
{
    // this contains the full local path to whatever is being checked in
    // can use this to find the solution file
    change.LocalItem;
}

(m_PendingChecking is of IPendingCheckin type)

Upvotes: 0

John Saunders
John Saunders

Reputation: 161773

Which .sln file? A single Team Project may have more than one.

If you want to get the path to the current solution while Visual Studio is running, then you can use the Visual Studio SDK to do that.

Upvotes: 1

Related Questions