I am having the strangest issue when attempting to reproject a raster image layer. Everything seems to work fine when the code is run locally, but when it’s put into production I get a rather cryptic error that points far into the bowels of MapSuite.Core:
System.ArgumentNullException: Value cannot be null.
Parameter name: ptr
at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)
at ohM=.jCQ=.kCQ=(Bitmap kSQ=, RectangleShape kiQ=, String kyQ=, String lCQ=)
at ThinkGeo.MapSuite.Core.Proj4Projection.ConvertToExternalProjectionCore(GeoImage image, RectangleShape imageExtent)
at ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
at ThinkGeo.MapSuite.Core.RasterLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
at ThinkGeo.MapSuite.Core.MapEngine.Lx0=(Layer MB0=, Object MR0=)
at ThinkGeo.MapSuite.Core.MapEngine.Fh0=(IEnumerable`1 Kh0=, Bitmap Kx0=, GeographyUnit LB0=, Boolean LR0=)
at ThinkGeo.MapSuite.Core.MapEngine.DrawStaticLayers(Bitmap gdiPlusBitmap, GeographyUnit mapUnit)
About the only thing out of the ordinary that I’m doing is using StreamLoading to grab my files instead of direct file path. Again, this works fine on my own machine, so I’m not sure why it would be any different on the production server. If I don’t try to re-project the file, everything works fine as well. Does the conversion to a projection possibly write to a temporary file? The identity the program is being run as is the only thing I could think of that would be different between the environments. I’m hoping someone’s seen SOMETHING like this before, because it would take far too long to put together a simplified example of what I’m doing, I’m afraid.