map.AddImageLayer() giving me "Object reference not set to an instance of an object."

Jun 30, 2013 at 5:29 AM
Hi,

I have a dotspatial based app that mostly works, but ".AddImageLayer()" is giving me a "Object reference not set to an instance of an object." error (stack trace showing "at DotSpatial.Controls.MapLayerCollection.Add(IImageData image) at DotSpatial.Controls.Map.AddImageLayer()").

(The error occurs after clicking [Open] in the file open dialog that appears on use of "AddImageLayer()").

I'm using 1.4, with GDAL for some raster layer help. This is in a .Net WPF App, with the map inside a WindowsFormsHost control. Compiling to 32 bit x86.

Stripping back the app, I find that I don't get the error, and an image loads with the above function, if I remove the app manager. That is, if I comment out the "LoadExtensions()" call, I don't get the error noted above.
appManager = new DotSpatial.Controls.AppManager();
// appManager.LoadExtensions();
What could be going on between the app manager and loading of an image layer?

Thanks,