So firstly, I start the server with
LocalServer.Instance.StatusChanged += ServerStatusChanged;
await LocalServer.Instance.StartAsync();
Then in the function
private async void ServerStatusChanged(object sender, StatusChangedEventArgs e)
I have these
if (e.Status == LocalServerStatus.Started)
{
_localMapService = new LocalMapService(Environment.CurrentDirectory + @"\Maps\Turceni_map.mpk");
_localMapService.StatusChanged += _localMapService_StatusChanged;
await _localMapService.StartAsync();
}
The exception is thrown when _localMapService tries to start. I have already verified the path is correct. Also, the server seems to start with no problem. What could be the cause ? I have also attached the class file
Solved! Go to Solution.
EDIT: I have resolved the issue, though it was very frustrating. I had to switch to JavaSDK to figure it out, fortunately the exception was much more suggestive there. The problem was that I had to enable RUNTIME SUPPORT in ArcMap before sharing the package. The option is found at
Customize > ArcMap Options > Enable ArcGIS Runtime Tools
.
EDIT: I have resolved the issue, though it was very frustrating. I had to switch to JavaSDK to figure it out, fortunately the exception was much more suggestive there. The problem was that I had to enable RUNTIME SUPPORT in ArcMap before sharing the package. The option is found at
Customize > ArcMap Options > Enable ArcGIS Runtime Tools
.