gdal icon indicating copy to clipboard operation
gdal copied to clipboard

GDAL C# plugins NuGet crash related to missing MSSQLSpatial DLL

Open MattScorah opened this issue 5 months ago • 2 comments

What is the bug?

When using the GDAL.Plugins NuGet package for the C# bindings, when Gdal.AllRegister() is called there is an unhandled exception in GDALConfiguration.cs:

Can't load requested DLL: *SolutionDirectory*\bin\Debug\net8.0\gdal\x64\plugins\ogr_MSSQLSpatial.dll 126: The specified module could not be found where SolutionDirectory is the .sln directory

This crash was not present in earlier versions; instead, a warning message was written to console.

Steps to reproduce the issue

Create a new C# solution (I am using Visual Studio Community 2022 and the console app template for a new solution) Tools > NuGet Package Manager > Manage packages for solution Install GDAL, GDAL.Native and GDAL.Plugins (I was using version 3.11.3 of the NuGet packages) Add the lines: GdalConfiguration.ConfigureGdal(); GdalConfiguration.ConfigureOgr(); Run the program

Versions and provenance

Tested on version 3.11.3 of the NuGet packages, downloaded through the Visual Studio UI The last version that worked without the crash was 3.4.3 as far as I can tell

Additional context

Apologies if this isn't the right place for this bug, or if it is the result of an intended change and is not a bug. I haven't been able to find any information about the issue, and given that the packages behaved differently in the past my guess was that this is a bug, but it could easily be user error on my part.

MattScorah avatar Jul 24 '25 05:07 MattScorah

CC @szekerest

rouault avatar Jul 24 '25 15:07 rouault

Como utilizo Gdal.OpenEx(..)?

JorgeMartinFerrer avatar Aug 25 '25 02:08 JorgeMartinFerrer