title: Exception while using GDAL in C#
body: <p>I started to use <strong>gdal_csharp</strong> dll in my application and read a geotiff file. but it says:</p>
  
  <pre><code>The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception.
  </code></pre>
  
  <p>it's my code</p>
  
  <pre><code>string fileName = @"/path to geotiff file";
  
  OSGeo.GDAL.Dataset DS = 
      OSGeo.GDAL.Gdal.Open(fileName, OSGeo.GDAL.Access.GA_ReadOnly);
  </code></pre>
  
  <p>can anyone help?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I have these dlls</p>
  
  <p><img src="https://i.stack.imgur.com/HCGEK.jpg" alt="enter image description here"></p>
  
  <p>This is the full error message:</p>
  
  <p><img src="https://i.stack.imgur.com/hfyEo.jpg" alt="enter image description here"></p>
  
  <p>It says that cannot load <code>gdal_wrap</code>. But when I'm going to add that dll to my application the below message is shown:</p>
  
  <p><img src="https://i.stack.imgur.com/iLiwQ.jpg" alt="enter image description here"></p>