Make sure to copy all the dll-s from the /bin and /bin/gdal/csharp directories into you application directory, or make the location of this files available in the PATH environment variable.<div><br></div><div>Best regards,</div>
<div><br></div><div>Tamas</div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">2013/6/28 Genhan Chen <span dir="ltr"><<a href="mailto:GChen@camsys.com" target="_blank">GChen@camsys.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="3" face="Book Antiqua">Hi Tamas,</font>
<br>
<br><font size="3" face="Book Antiqua">I am using pre-compiled <b>ogr_csharp.dl</b>l,
downloaded from </font><a href="http://vbkto.dyndns.org/sdk/" target="_blank"><font size="3" color="blue" face="Book Antiqua"><u>http://vbkto.dyndns.org/sdk/</u></font></a><font size="3" face="Book Antiqua">
. I added "<b>using OSGeo.OGR</b>" in front of the class. and
did not see any error during build process.</font>
<br>
<br><font size="3" face="Book Antiqua">However, I got the following error
message if any Ogr method (e.g. "<b>Ogr.RegisterAll()</b>;")
was added in the program.:</font>
<br>
<br><font size="3" face="Book Antiqua"><b>{"The type initializer for
'OSGeo.OGR.OgrPINVOKE' threw an exception."}      
 </b></font>
<br><font size="3" face="Book Antiqua"><b>System.Exception {System.TypeInitializationException}</b></font>
<br>
<br><font size="3" face="Book Antiqua">Do you know what caused this error?</font>
<br>
<br><font size="3" face="Book Antiqua">Thanks a lot,</font>
<br><div class="im">
<br><font face="sans-serif">Genhan Chen<br>
Cambridge Systematics, Inc.<br>
555 12th Street, Suite 1600<br>
Oakland CA 94607<br>
tel  <a href="tel:510%20873%208700" value="+15108738700" target="_blank">510 873 8700</a><br>
fax  <a href="tel:510%20873%208701" value="+15108738701" target="_blank">510 873 8701</a><br>
e-mail <a href="mailto:gchen@camsys.com" target="_blank">gchen@camsys.com</a><br>
</font><a href="http://www.camsys.com" target="_blank"><font face="sans-serif">www.camsys.com</font></a>
<br>
<br>
<br>
<br></div><font size="1" color="#5f5f5f" face="sans-serif">From:      
 </font><font size="1" face="sans-serif">Tamas Szekeres <<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>></font>
<br><font size="1" color="#5f5f5f" face="sans-serif">To:      
 </font><font size="1" face="sans-serif">Genhan Chen <<a href="mailto:GChen@camsys.com" target="_blank">GChen@camsys.com</a>>,
</font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Cc:      
 </font><font size="1" face="sans-serif"><a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a></font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Date:      
 </font><font size="1" face="sans-serif">06/26/2013 11:28 PM</font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Subject:    
   </font><font size="1" face="sans-serif">Re: [gdal-dev]
C# version of ogr2ogr function</font>
<br>
<hr noshade><div class="HOEnZb"><div class="h5">
<br>
<br>
<br><font size="3">Please refer to this thread for further information: </font><a href="http://lists.osgeo.org/pipermail/gdal-dev/2009-March/020130.html" target="_blank"><font size="3" color="blue"><u>http://lists.osgeo.org/pipermail/gdal-dev/2009-March/020130.html</u></font></a>
<br>
<br><font size="3">Best regards,</font>
<br>
<br><font size="3">Tamas</font>
<br>
<br><font size="3"><br>
</font>
<br><font size="3">2013/6/26 Genhan Chen <</font><a href="mailto:GChen@camsys.com" target="_blank"><font size="3" color="blue"><u>GChen@camsys.com</u></font></a><font size="3">></font>
<br><font size="3" face="sans-serif">Hello,</font><font size="3"> <br>
</font><font size="3" face="sans-serif"><br>
I need a function (similar to ogr2ogr) to convert Shapefile into GeoJson
format. </font><font size="3"><br>
</font><font size="3" face="sans-serif"><br>
How can I implement this function using C#, in .NET framework?</font><font size="3">
<br>
</font><font size="3" face="sans-serif"><br>
Any help is really appreciated! </font><font size="3" color="#8f8f8f"><br>
</font><font size="3" color="#8f8f8f" face="sans-serif"><br>
Genhan Chen<br>
Cambridge Systematics, Inc.<br>
555 12th Street, Suite 1600<br>
Oakland CA 94607<br>
tel  </font><a href="tel:510%20873%208700" target="_blank"><font size="3" color="blue" face="sans-serif"><u>510
873 8700</u></font></a><font size="3" color="#8f8f8f" face="sans-serif"><br>
fax  </font><a href="tel:510%20873%208701" target="_blank"><font size="3" color="blue" face="sans-serif"><u>510
873 8701</u></font></a><font size="3" color="#8f8f8f" face="sans-serif"><br>
e-mail </font><a href="mailto:gchen@camsys.com" target="_blank"><font size="3" color="blue" face="sans-serif"><u>gchen@camsys.com</u></font></a><font size="3" color="blue"><u><br>
</u></font><a href="http://www.camsys.com/" target="_blank"><font size="3" color="blue" face="sans-serif"><u>www.camsys.com</u></font></a><font size="3"><br>
_______________________________________________<br>
gdal-dev mailing list</font><font size="3" color="blue"><u><br>
</u></font><a href="mailto:gdal-dev@lists.osgeo.org" target="_blank"><font size="3" color="blue"><u>gdal-dev@lists.osgeo.org</u></font></a><font size="3" color="blue"><u><br>
</u></font><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank"><font size="3" color="blue"><u>http://lists.osgeo.org/mailman/listinfo/gdal-dev</u></font></a>
<br>
<br></div></div></blockquote></div><br></div>