ThinkGeo.com    |     Documentation    |     Premium Support

Nautical Chart Reference Issue

Hi,

I’m getting some issue with adding the Nautical charts layer to my project. The error below says I am missing the GdalS57.nupkg, but it is in fact in my packages folder. All my libraries are at the most up to date build. Any ideas?

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.TypeInitializationException: The type initializer for ‘nhc=.uk4=’ threw an exception. —> System.InvalidOperationException: This function relies on MapSuiteDependency-GdalS57.nupkg. Please install this package first. Or this function is not support on Windows
at ThinkGeo.MapSuite.UnmanagedAssembliesHelper.GetAssemblyPathFilename(String directoryName, String assemblyName, PclPlatform platform)
at nhc=.uk4=…cctor()
— End of inner exception stack trace —
at nhc=.uk4=.vE4=()
at ThinkGeo.MapSuite.Layers.NauticalChartsFeatureSource…ctor(String nauticalChartsPathFilename)
at ThinkGeo.MapSuite.Layers.NauticalChartsFeatureSource.BuildIndexFile(String nauticalChartsFilePathname, BuildIndexMode buildIndexMode, Encoding encoding)
at SurveyDesign.Map.AddNautical(List`1 files)

Thanks,
Damian

Thanks Damian,
Are you using mapsuite 12. If so you need ThinkGeo.NauticalCharts package instead of the ThinkGeo.MapSuite.Layers.NauticalCharts

https://www.nuget.org/packages/ThinkGeo.NauticalCharts/13.0.0-beta152

For mapsuite 10. I attach you a demo project to load the NauticalCharts

HelloWorld.zip (1.5 MB)

Thanks

Frank

Hi Frank,

I’m using v10. Can you not see the image from NuGet Package Manager I included?

I don’t have any issue to run a small test project. My issue is when I integrate the same code from my test project into my large scale project. It’s similar to another issue I reported in 2019 where I loaded a library and suddenly got errors about packages not being installed that were.

I cleaned the packages folder and reloaded from NuGet. I’ve also cleaned bin directories and rebuilt. There are no rebuild errors. The issue only occurs when running the code and trying to initialize the nautical layer.

I’m at a loss for what to try next…

Regards,
Damian

Thanks Damian,
I got this issue before. For some reason the visual studio may not copy the dependency to the bin folder. You could manually copy these folder to the bin folder.

bin\Debug\Windows-X64
bin\Debug\Windows-X86

Or you could remove the ThinkGeo related nugget package from the package manager and re-add them.

Thanks

Frank

Hi Frank,

Yes, those folders did not get copied, but that did not fix my issue right away.

In addition to the folders not being copied, the GdalS57 directories were missing the following file:

ThinkGeo.MapSuite.Wrappers.S57X64.dll

Adding this fixed the problem.

I only found this by comparing the files from my test project, but otherwise would have no idea I was missing anything. I didn’t get any errors when adding the package from NuGet. Any ideas what went wrong? Pretty nasty issue if NuGet isn’t downloading everything it should.

Regards,
Damian

Thanks Damian,
I don’t think anything you did wrong. For some reason such as upgrade the solution/project file from lower visual studio to a newer version. The nugget may not work as we excepted. So may need manually remove the nugget package and re-add them by nugget manager. Or we could use the compare tool to compare the folder with a simple new test project and find out which folder(s) not copied to the target folder.

Thanks

Frank