Hi,<br><br>What kind of exception has been thrown? Perhaps a missing dll may cause like this.<br><br>Tamas<br><br><br><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup {  position:absolute;  z-index:9999;  padding: 0px 0px;  margin-left: 0px;  margin-top: 0px;  width: 240px;  overflow: hidden;  word-wrap: break-word;  color: black;  font-size: 10px;  text-align: left;  line-height: 13px;}</style><div class="gmail_quote">
2010/6/25 mail2vajram <span dir="ltr">&lt;<a href="mailto:mail2vajram@gmail.com">mail2vajram@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
i installed fwtols2.4.7 previously.That time i worked  with gdal with out any<br>
problem but now when i work with gdal it throws the following<br>
exception.....why. how to fix this.<br>
<br>
<br>
The type initializer for &#39;OSGeo.GDAL.GdalPINVOKE&#39; threw an exception.<br>
<br>
This is the way i used.....<br>
<br>
[DllImport(&quot;kernel32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]<br>
        public static extern bool SetEnvironmentVariable(string lpname,<br>
string lpvalue);<br>
        string GDAL_HOME = @&quot;;C:\Program Files\FWTools2.4.7\bin&quot;;<br>
string path = Environment.GetEnvironmentVariable(&quot;PATH&quot;);<br>
            path += &quot;;&quot; + GDAL_HOME;<br>
            SetEnvironmentVariable(&quot;PATH&quot;, path);<br>
            Gdal.AllRegister();<br>
<br>
<br>
help me thank you....<br>
<font color="#888888">--<br>
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/The-type-initializer-for-OSGeo-GDAL-GdalPINVOKE-threw-an-exception-when-gdal-Allregister-calls-tp5220732p5220732.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/The-type-initializer-for-OSGeo-GDAL-GdalPINVOKE-threw-an-exception-when-gdal-Allregister-calls-tp5220732p5220732.html</a><br>

Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</font></blockquote></div><br>