We have a tool in our application that allows adding map layers from many sources. Recently, a customer has asked us to include data from a service they have published to their ArcGIS Server. There are many layers in this service. Most layers load without issue. A few will not load and fail with "Geodatabase field not found." message. We are able to view the data from the REST endpoint and even use the ArcGIS Online Map Viewer to view the data. All looks good there.
We are using ArcGIS .NET Maps SDK version 200.8.1 on WPF and MAUI (Android and iOS). We are having the same issue on all platforms.
The customer indicates that it loads in the Online Viewer so there can't be a problem with the service. How can we determine the problem? No detailed information is given using the debugger.
Below is the very simple code:
private async Task<bool> add_Feature_Layer(Uri layerName)
{
// Create new FeatureLayer from service uri and
FeatureLayer AGOLLayer = new FeatureLayer(layerName);
try
{
await AGOLLayer.LoadAsync();
// Add created layer to the map
_vm.MapControlMap.Map.OperationalLayers.Insert(0, AGOLLayer);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
await AGOLLayer.RetryLoadAsync();
}
return true;
}