VersionControlServer.TryGetTeamProject Method

At the top level of the Team Foundation Server folder hierarchy are the team projects; the folders immediately under $/ in the tree. All folders and files under source control are directly or indirectly under the team projects. This function gets a specified team project.

Namespace:  Microsoft.TeamFoundation.VersionControl.Client
Assembly:  Microsoft.TeamFoundation.VersionControl.Client (in Microsoft.TeamFoundation.VersionControl.Client.dll)

Syntax

'Declaration
Public Function TryGetTeamProject ( _
    name As String _
) As TeamProject
'Usage
Dim instance As VersionControlServer 
Dim name As String 
Dim returnValue As TeamProject 

returnValue = instance.TryGetTeamProject(name)
public TeamProject TryGetTeamProject(
    string name
)
public:
TeamProject^ TryGetTeamProject(
    String^ name
)
public function TryGetTeamProject(
    name : String
) : TeamProject

Parameters

  • name
    Type: System.String

    The name must specify a team project directly ($/CmdLine). To get the team project associated with any arbitrary file or folder inside Team Foundation Server, you should use TryGetTeamProjectForServerPath.

Return Value

Type: Microsoft.TeamFoundation.VersionControl.Client.TeamProject
The returned TeamProject object contains the name (which you passed in), check-in and checkout policies, and note fields for the specified team project. If no project is found, null is returned. You can use the GetTeamProject method to throw an exception in this case.

.NET Framework Security

See Also

Reference

VersionControlServer Class

VersionControlServer Members

Microsoft.TeamFoundation.VersionControl.Client Namespace