Some people in Gdal forum ask me to try the GDAL nuget package. May someone help me regarding how to use the GDAL nuget package at nuget.org and may i know it still need to set up just like use in C++?
-
Sorry, general software/tool questions are off-topic at Stack Overflow. – jazb Nov 26 '18 at 03:40
-
Any update for this issue? Have you resolved this issue? If not, would you please let me know the latest information about this issue? – Leo Liu Nov 30 '18 at 01:16
-
@LeoLiu-MSFT it seem my VS2012 cant use the nuget package gdal cause it require nuget update 3.0 and above. So i just download the package from [GISInternal wbsite](https://www.gisinternals.com/) website and add reference to the VS2012. You then can try example from [here](https://svn.osgeo.org/gdal/trunk/gdal/swig/csharp/apps/). Also can refer [this](http://vipassanaandenvironmentalinformatics.blogspot.com/2013/03/getting-started-with-c-and-gdal.html). – ThingThing Dec 10 '18 at 03:40
-
@MohamadFathin, Yes, NuGet **3.3** or higher is requires. – Leo Liu Dec 10 '18 at 03:42
1 Answers
how to use the GDAL nuget package at nuget.org and may i know it still need to set up just like use in C++?
Right on your project, select Manage NuGet Packages...
, switch to the Browse
tab in the open window, type gdal
in the search bar, then click Install
button:
If you install GDAL
to your project you will get the .dll
file you need and NuGet also automatically create a GdalConfiguration.cs
that you call into to initialize the GDAL paths before starting. The only thing to note is the packages are setup to automatically copy their appropriate GDAL libraries to your output build directory. If you need to deploy the application you'll have to do a bit of extra effort.
Besides, you do not need to set up just like use in C++. For some more details info, please check following threads:
How do I install the GDAL bindings for C#/.NET 4.5.1?
Exception while using GDAL in C#
Hope this helps.

- 71,098
- 10
- 114
- 135
-
1It seems that installing only GDAL is not enough anymore, so you also need to install GDAL.Core package. If the config file does not get created you can call Gdal.AllRegister() to get it to work quickly. – gtu Jun 19 '21 at 20:51
-
@gtu's comment is a useful breadcrumb. However, my C# app is using .NET Framework 4.6, not .NET Core. Thus, for me the additional thing to install from the NuGet Package Manager was GDAL.Native instead of GDAL.Core. – Mike Finch Mar 26 '22 at 23:47