The MosaicDatasetRaster must be created in the same spatial reference as the raster datasets that must be added to the mosaic.
Change:
var mdsRaster = MosaicDatasetRaster.Create(mgdbPath, name, SpatialReferences.WebMercator);
To:
var mdsRaster = MosaicDatasetRaster.Create(mgdbPath, name, SpatialReference.Create(2264));
The GDALData folder must be deployed and referenced by the application.
Refer to https://developers.arcgis.com/net/latest/wpf/guide/spatial-references.htm for more information.
Follow the steps:
1. Log in to ArcGIS for Developers and download Projection Engine Data from ArcGIS for Developers > Dashboard > Download.
2. Copy the gdaldata folder to a folder to be deployed along with your application.
E.g.: '\PEDataRuntime'
3. Set the ProjectionEngineDirectory property.
E.g.: In App.Xaml.cs:
TransformationCatalog.ProjectionEngineDirectory = @"..\..\PEDataRuntime";