ThinkGeo.com    |     Documentation    |     Premium Support

Loading image error after upgrade

Hi,

I’m upgrading an application from version 9 to 10.5 and I’ve encountered quite a few issues which may be related.

My typical code for loading an image to an overlay was using GdiPlusRasterLayer and now I’ve converted that to NativeImageRasterLayer.

var layer = new NativeImageRasterLayer(fileName, worldFileName);

When I add the layer to the map and refresh, I get the following message on a pink screen.

the type initializer for ‘hyY=Ikk=’ threw and exception

Sounds like some library conflicts, but I don’t see anything odd. Since I’m using v10.5, I’m pulling everything from NuGet so I don’t expect anything out of date. Since it’s an upgrade project, is the original winformsMap component coming from my version 9 which is still installed?

FYI: Same message appears for adding Google, WMS and Open Streets layers.

Thanks,
Damian

Thanks,
Yes. It might some conflicts. We recommend create a mapsuite 10 project from ground. Then copy you class to the mapsuite 10 project. I build a demo project for you to use the NativeImageRasterLayer.

WindowsFormsApp6.zip (746.7 KB)

I also create a video to show you how to build it from begin.

Thanks

Frank

Hi Frank,

It’s not an option to create the project from the ground up. It’s 3 years of development and +1M lines of code.

I have also verified that I can create a project from scratch and it runs fine with same package versions and runtime settings.

What I need is some help diagnosing the error. I can’t even tell what it means.

Also, I tried setting the image DrawingExceptionMode to ThrowException and then try to capture it with the DrawingException event, but it still prints the error to the map so I’ve no way to provide any further details. That issue you can probably send on to developers.

I am going to submit a support ticket on this one as I need it sorted ASAP.

Thanks,
Damian

Thanks Damian,

 As we mentioned in the support ticket. This MapSuiteDependency-UnmanagedProj4Projection issue we met this issue before. When this happen we uninstall the MapSuiteDependency-UnmanagedProj4Projection and re-install it. Then it will work. Or downgarde the MapSuiteDependency-UnmanagedProj4Projection to a lower version and upgrade it back to the latest one.

Thanks

Frank