[gdal-dev] How to use GDAL from Nuget in C#?

Casper Børgesen caboe at sdfe.dk
Sun Oct 20 09:45:38 PDT 2019


Hi!

I have created a C# WPF (.NET Framework 4.6.1) application in Visual Studio 2017 and installed latest stable GDAL 2.4.2 from Nuget.

In the App.xaml I have added the GDAL configuration call:

protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);

    GdalConfiguration.ConfigureGdal();
}

When I build the application I get the following error:

"error CS0103: The name 'GdalConfiguration' does not exist in the current context"

I can find the GdalConfiguration.cs file in the subfolder "obj\Debug\NuGet\15f0ca2b5ecbe407152208e918cf2c4389b630a2\GDAL\2.4.2" and pressing F12 on "GdalConfiguration.ConfigureGdal()" opens up that specific file.

Do I have to do anything else to be able to use GDAL in my application? And whats the difference between GDAL and GDAL.Native available from Nuget?

Regards, Casper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20191020/d653bfdd/attachment.html>


More information about the gdal-dev mailing list