<div dir="ltr">Alright well I figure that out...Targeted a specific MSVC_VER in csharp.opt</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 9, 2015 at 5:02 PM kelly elton <<a href="mailto:its.the.doc@gmail.com">its.the.doc@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm getting this error after compiling from source<div><br></div><div><div>Exception thrown: 'System.MethodAccessException' in gdal_csharp.dll</div><div><br></div><div>Additional information: Attempt by security transparent method 'OSGeo.GDAL.Gdal.UseExceptions()' to call native code through method 'OSGeo.GDAL.GdalPINVOKE.UseExceptions()' failed.  Methods must be security critical or security safe-critical to call native code.</div></div><div><br></div><div>I did </div><div>nmake -f <a href="http://makefile.vc" target="_blank">makefile.vc</a> clean && nmake -f <a href="http://makefile.vc" target="_blank">makefile.vc</a> MSVC_VER=1600 DEBUG=1 && nmake -f <a href="http://makefile.vc" target="_blank">makefile.vc</a> install<br></div><div>cd swig</div><div>nmake -f <a href="http://makefile.vc" target="_blank">makefile.vc</a> csharp</div><div><br></div><div>I get the gdal dll + the csharp dlls...and I use them</div><div><br></div><div>But as soon as I call OSGeo.GDAL.Gdal.UseExceptions(); I get the exception</div><div><br></div><div>This doesn't happen with the dll's I've downloaded from <a href="http://www.gisinternals.com/" target="_blank">http://www.gisinternals.com/</a></div><div><br></div><div>I got the source from <a href="https://trac.osgeo.org/gdal/wiki/DownloadSource" target="_blank">https://trac.osgeo.org/gdal/wiki/DownloadSource</a> and I got 2.0.1</div></div></blockquote></div>