<html><head></head><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:13px"><br><div id="yui_3_16_0_1_1447583135985_9539" style="font-family: verdana, helvetica, sans-serif; font-size: 13px;"><div id="yui_3_16_0_1_1447583135985_9538" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"><div id="yui_3_16_0_1_1447583135985_9537" class="y_msg_container"><font size="2" face="verdana, helvetica, sans-serif">Hello,<br><br></font><div id="yiv4851463721"><div id="yui_3_16_0_1_1447583135985_9536"><div id="yui_3_16_0_1_1447583135985_9535" style="color:#000;background-color:#fff;font-family:verdana, helvetica, sans-serif;font-size:13px;"><div id="yiv4851463721yui_3_16_0_1_1447257529980_20478" style="font-family:verdana, helvetica, sans-serif;font-size:13px;"><div id="yiv4851463721yui_3_16_0_1_1447257529980_20477" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div id="yui_3_16_0_1_1447583135985_9757" dir="ltr"><font id="yui_3_16_0_1_1447583135985_9888" size="2" face="verdana, helvetica, sans-serif">Does anyone know, how to <span class="" id="yui_3_16_0_1_1447583135985_9743" style="color: rgb(34, 34, 34); font-size: 12.8px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; display: inline ! important; float: none; background-color: rgb(255, 255, 255);">load a file to a gdal data set </span>in ironpython through gdal_csharp.dll?</font></div><font size="2" face="verdana, helvetica, sans-serif"><br></font><div id="yui_3_16_0_1_1447583135985_9648"><font id="yui_3_16_0_1_1447583135985_9887" size="2" face="verdana, helvetica, sans-serif">I tried the following:</font></div><blockquote id="yui_3_16_0_1_1447583135985_9938"><div id="yui_3_16_0_1_1447583135985_9649" dir="ltr"><font id="yui_3_16_0_1_1447583135985_9885" size="2" face="verdana, helvetica, sans-serif">from clr import AddReferenceToFileAndPath as addref<br class="" id="yui_3_16_0_1_1447583135985_9637">addref(<font id="yui_3_16_0_1_1447583135985_10106" color="#9d1811">"c:/gdal/gdal_csharp.dll"</font>)<br class="" id="yui_3_16_0_1_1447583135985_9639"><br class="" id="yui_3_16_0_1_1447583135985_9641">import OSGeo.GDAL as gdalcsharp<br class="" id="yui_3_16_0_1_1447583135985_9643"><br class="" id="yui_3_16_0_1_1447583135985_9645">readOnlyAccess = gdalcsharp.Access.GA_ReadOnly<br class="" id="yui_3_16_0_1_1447583135985_9647">dataSet = gdalcsharp.Gdal.Open(<font id="yui_3_16_0_1_1447583135985_10105" color="#9d1811">"c:/gdal/elevations.asc"</font>, readOnlyAccess)</font></div></blockquote><div id="yui_3_16_0_1_1447583135985_9650" dir="ltr"><font size="2" face="verdana, helvetica, sans-serif"><br></font></div><div id="yui_3_16_0_1_1447583135985_9683" dir="ltr"><font id="yui_3_16_0_1_1447583135985_9890" size="2" face="verdana, helvetica, sans-serif">But at the last line, an exception arise:</font></div><blockquote id="yui_3_16_0_1_1447583135985_10174"><div id="yui_3_16_0_1_1447583135985_9651" dir="ltr"><font id="yui_3_16_0_1_1447583135985_9847" size="2" face="verdana, helvetica, sans-serif"><span class="" id="yui_3_16_0_1_1447583135985_9682" style="color: rgb(34, 34, 34); font-size: 12.8px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; display: inline ! important; float: none; background-color: rgb(255, 255, 255);">The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception.</span></font></div></blockquote><div class="yiv4851463721y_msg_container" id="yiv4851463721yui_3_16_0_1_1447257529980_20485"><div id="yiv4851463721"><div class="qtdSeparateBR"><br><br></div><div class="yiv4851463721yqt8796480696" id="yiv4851463721yqtfd49207"><div id="yiv4851463721yui_3_16_0_1_1447257529980_20493"><div id="yiv4851463721yui_3_16_0_1_1447257529980_20492" style="color:#000;background-color:#fff;font-family:verdana, helvetica, sans-serif;font-size:13px;"><div id="yiv4851463721yui_3_16_0_1_1446629612702_15682" style="font-family:verdana, helvetica, sans-serif;font-size:13px;"><div id="yiv4851463721yui_3_16_0_1_1446629612702_15681" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div class="yiv4851463721" id="yiv4851463721yui_3_16_0_1_1445955866554_5193"><div dir="ltr" id="yiv4851463721yui_3_16_0_1_1447257529980_21821"><div id="yui_3_16_0_1_1447583135985_10199"><font id="yiv4851463721yui_3_16_0_1_1446629612702_15944" size="2" face="verdana, helvetica, sans-serif">What is the problem? Am I defining the Access incorrectly?</font></div><div id="yui_3_16_0_1_1447583135985_10200"><font id="yiv4851463721yui_3_16_0_1_1446629612702_15944" size="2" face="verdana, helvetica, sans-serif">Thank you in advance.<br></font></div><font id="yiv4851463721yui_3_16_0_1_1446629612702_15944" size="2" face="verdana, helvetica, sans-serif"><div class="yiv4851463721yqt3111674248" id="yiv4851463721yqtfd12252"><br clear="none">Kind regards,<br clear="none">Djordje Spasic</div></font></div></div><div class="yiv4851463721yqt3111674248" id="yiv4851463721yqtfd48518"> </div></div><div class="yiv4851463721yqt3111674248" id="yiv4851463721yqtfd88482"><br clear="none"><br clear="none"></div></div></div></div></div></div></div><div class="yiv4851463721yqt3111674248" id="yiv4851463721yqtfd70016"> </div></div></div></div></div></div><br></div> </div> </div> </div></body></html>