Search code examples
c#tfs-sdk

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.


Solution

  • 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)