The code that raises the exception:
private async Task LoadShapefile(string path)
try
FeatureOverlay.Visibility = Visibility.Collapsed;
// open shapefile table
var shapefile = await ShapefileTable.OpenAsync(path);
// clear existing map and spatial reference
if (Map1.Map.Layers.Any())
Map1.Map = new Map();
// create feature layer based on the shapefile
var flayer = new FeatureLayer(shapefile)
// Add the feature layer to the map
txtInfo.Visibility = Visibility.Visible;
catch (Exception ex)
MessageBox.Show("Error creating feature layer: " + ex.Message, "Sample Error");
txtInfo.Visibility = Visibility.Collapsed;
Any idea ?