Class LocalServer
A singleton representing a local server. This class enables a number of LocalService types to be created based on local geographic content.
Namespace: Esri.ArcGISRuntime.LocalServices
Assembly: Esri.ArcGISRuntime.LocalServices.dll
Syntax
public sealed class LocalServer
Remarks
Before using the LocalServer the runtime deployment must be licensed with a valid license string. For more information please see the ArcGISRuntimeEnvironment class. Once the license string has been set and the ArcGISRuntime initialized, the recommended approach to start the LocalServer is by calling the asynchronous InitializeAsync method and listening for the InitializeCompleted event or by using the overloaded Initialize(Action) method and passing in an action callback delegate.
To determine the current state of the LocalServer the Status property will provide a LocalServerStatus value or alternatively the property IsRunning can be used to quickly determine whether the LocalServer is currently running.
Finally, when the LocalServer is no longer required the asynchronous ShutdownAsyncTask method should be called to shutdown the LocalServer and recover any resources being used. Once the LocalServer has shutdown it will trigger the ShutdownCompleted event, or alternatively you can use the overloaded ShutdownAsyncTask() method to provide an action callback delegate.
It is not necessary to work with the LocalServer directly. Instead, creating and starting the individual LocalService classes ( LocalMapService, LocalFeatureService, and LocalGeoprocessingService) will start the LocalServer if it is not already running.
Properties
Name | Description |
---|---|
AppDataPath | Gets or sets the application data path for the runtime deployment used by this application. |
Error | Gets the associated error if the server's Status is FailedToLoad. |
FilterWebContent | Gets or sets a value indicating whether to filter web content. Turns on filtering of HTML content for feature service text fields. By default this is enabled. When this is enabled only a small subset of HTML is accepted and an error will occur if unsupported HTML is used. Filter web content should be set to disabled if you want to use unfiltered HTML. |
Instance | Gets the single LocalServer instance. This is the only way to get a LocalServer instance. |
Services | Gets the collection of active local services. These services can be in a starting, stopping, or running state. |
Status | Gets the current status of the LocalServer. |
Url | Gets the base URL of the local server. For example: http://127.0.0.1:50000/arcgis/rest |
Methods
Name | Description |
---|---|
StartAsync() | Asynchronously starts the local server. The server can only be started from the STOPPED or FAILED states. |
StopAsync() | Asynchronously shuts down the LocalServer. |
Events
Name | Description |
---|---|
StatusChanged | Occurs when Status of this local server has changed. |
Applies to
Target | Versions |
---|---|
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.0 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |