ILocationService.LocationForCurrentConnection Method (String, Guid)

Returns the location for the ServiceDefintion associated with the ServiceType and ServiceIdentifier that should be used based on the current connection. If a ServiceDefinition with the ServiceType and ServiceIdentifier does not exist then null will be returned. If a ServiceDefinition with the ServiceType and ServiceIdentifier is found then a location will be returned if the ServiceDefinition is well formed (otherwise an exception will be thrown). When determining what location to return for the ServiceDefinition and current connection the following rules will be applied: 1. Try to find a location for the ClientAccessMapping. 2. Try to find a location for the DefaultAccessMapping. 3. Use the first location in the LocationMappings list.

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

Syntax

'Declaration
Function LocationForCurrentConnection ( _
    serviceType As String, _
    serviceIdentifier As Guid _
) As String
string LocationForCurrentConnection(
    string serviceType,
    Guid serviceIdentifier
)
String^ LocationForCurrentConnection(
    String^ serviceType, 
    Guid serviceIdentifier
)
abstract LocationForCurrentConnection : 
        serviceType:string * 
        serviceIdentifier:Guid -> string
function LocationForCurrentConnection(
    serviceType : String, 
    serviceIdentifier : Guid
) : String

Parameters

  • serviceType
    Type: System.String

    The service type of the ServiceDefinition to find the location for.

  • serviceIdentifier
    Type: System.Guid

    The service identifier of the ServiceDefinition to find the location for.

Return Value

Type: System.String
The location for the ServiceDefinition with the provided service type and identifier that should be used based on the current connection.

Exceptions

Exception Condition
InvalidServiceDefinitionException

The associated ServiceDefinition is not valid and no location can be found.

.NET Framework Security

See Also

Reference

ILocationService Interface

LocationForCurrentConnection Overload

Microsoft.TeamFoundation.Framework.Client Namespace