ArcGIS Pro 2.6 API Reference Guide
AddLocatorAsync Method

ArcGIS.Desktop.Mapping.Geocoding Namespace > LocatorManager Class : AddLocatorAsync Method
provider path. Can be a local file (ending in .loc) or a online geocode service.
Add a locator to the set of available locators.
Syntax
public Task<LocatorProvider> AddLocatorAsync( 
   string providerPath
)
Public Function AddLocatorAsync( _
   ByVal providerPath As String _
) As Task(Of LocatorProvider)

Parameters

providerPath
provider path. Can be a local file (ending in .loc) or a online geocode service.

Return Value

Task of bool indicating success or failure.
Remarks
Three different types of locators are supported : Local locators - example: D:\\Data\\Geocode\\ACT.loc Locators shared to portal - example: https://portal/server/rest/services/locatorName/GeocodeServer Geocoding services associated with an ArcGIS Server connection "ags" file - example: C:\\path\\my_ags_server\\locatorName.GeocodeServer". Note: the suffix .GeocodeServer is required. "C:\\path\\my_ags_server" is the fullpath (without suffix) to the ags connection file ""C:\\path\\my_ags_server.ags"
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

LocatorManager Class
LocatorManager Members