This sample program works when debugging, but when I publish it and start the .exe from the bin\Release\netcoreapp3.1\publish directory, I get an error message “World.sid’ not recognized as a supported file format.”
private void MapView_Loaded(object sender, RoutedEventArgs e)
{
mapView.MapUnit = GeographyUnit.DecimalDegree;
var layer = new MrSidRasterLayer(@".....\World.sid");
layer.Open();
var layersOverlay = new LayerOverlay();
layersOverlay.Layers.Add(layer);
mapView.Overlays.Add(layersOverlay);
mapView.CurrentExtent = new RectangleShape(-180, 90, 180, -90);
}
I notice that the gdal_MrSID.dll file is normally in the gdalplugins subdirectory, but that the publishing process puts it directly into the publish directory. This does not happen with the gdaldata subdirectory.