Skip to content

GDAL C# plugins NuGet crash related to missing MSSQLSpatial DLL #12787

@MattScorah

Description

@MattScorah

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions