2

I'm gonna use GDAL into visual studio for c# on windows. And followed some steps through some posts. However, it seems it doesn't work between steps and, the biggest problem is that it can't build and install.

I will explain how to install, then if any of you knows and let me know why i can't install it, it will be so helpful.

  1. to download: Stable Releases, GDAL2.1.2 and MapServer 7.0.2, MSVC 2013/x64(mine:64), gdal-201-1800-x64-core.msi. link: http://www.gisinternals.com/query.html?content=filelist&file=release-1800-x64-gdal-2-1-2-mapserver-7-0-2.zip

  2. to set up paths: System -> Advanced system settings -> System Properties -> Environment Variables => Edit System Variable: Path, C:\Program Files\GDAL\csharp Add System Variable: GDAL, C:\Program Files\GDAL (i also add two more: C:\Program Files\GDAL\gdalplugins, C:\Program Files\GDAL\gdal-data with names)

  3. I downloaded a sample to test this environment setting. (http://svn.osgeo.org/gdal/trunk/gdal/swig/csharp/apps/GDALInfo.cs)

  4. (visual studio 2013)Add four of the dll-files(gdal_csharp.dll, gdalconst_csharp.dll, ogr_csharp.dll and osr_csharp.) to my project references from C:\Program Files\GDAL\csharp(there was no gdalconst_cshap.dell though, i download it from a site i found).

  5. Change Platform target to x64 in Properties.

  6. Run the program. 1) nothing happened. 2) in the case, i forced to change the running goes to Gdal.AllRegister() to chech if GADL and VS are linked though, it said "The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception."

// I know there must be something i missed during process, but i think for now i can't find anymore. any help or hints or suggestion will be very welcomed!

Jin25
  • 73
  • 1
  • 6
  • i checked below sites: http://vipassanaandenvironmentalinformatics.blogspot.kr/2013/03/getting-started-with-c-and-gdal.html, https://trac.osgeo.org/gdal/wiki/BuildingOnWindows, https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows, http://cartometric.com/blog/2011/10/17/install-gdal-on-windows/, http://www.gisinternals.com/release.php, http://svn.osgeo.org/gdal/trunk/gdal/swig/csharp/apps/GDALInfo.cs – Jin25 Dec 07 '16 at 01:45
  • Did you try [GDAL 1.11.1 NuGet from Package Manager Console](https://www.nuget.org/packages/GDAL/) for NuGet. You can have a look at [How to use Package Manager Console](http://stackoverflow.com/a/40416621/3796048) – Mohit S Dec 07 '16 at 01:50
  • I just tried it as your kind reply though, the result hasn't changed. I still wonder if I installed it in right way. – Jin25 Dec 07 '16 at 03:01

0 Answers0