[gdal-dev] Issue with SetConfigOption

Pouliot, Christopher (DNR) Christopher.Pouliot at state.mn.us
Wed Mar 21 07:11:15 EDT 2012


I'm not sure if this is what you're looking for.  Here’s the Catch block in my C# code:

catch (Exception e)
{
    MessageBox.Show(e.Source + " - " + e.Message + 
    Environment.NewLine + e.InnerException.Message + Environment.NewLine + 
    e.InnerException.StackTrace + Environment.NewLine, 
    System.Reflection.MethodBase.GetCurrentMethod().Name);
}

Which gives a resulting error:
Gdal_csharp - The type initialize for 'OSGeo.GDAL.GdalPINVOKE' threw an exception
The type initialize for 'SWIGExceptionHelper' threw an exception
At OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper..ctor()
At OSGeo.GDAL.GdalPINVOKE..cctor()


Is there a way to get a more specific exception message?

Chris


From: Tamas Szekeres [mailto:szekerest at gmail.com] 
Sent: Monday, March 19, 2012 11:29 AM
To: Pouliot, Christopher (DNR)
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Issue with SetConfigOption

What is the exception message specifically?

Best regards,

Tamas

2012/3/19 Pouliot, Christopher (DNR) <Christopher.Pouliot at state.mn.us>
Hello,

The App I'm using GDAL in is a C# (Visual Studio 2010, .NET 4.0) executable and is distributed to a couple thousand people.  For 95% of those people it is running great.  For the other 5% we're having trouble with the GDAL piece.  The error we get:  "The type initialize for 'OSGEO.GDAL.GdalPINVOKE' threw an exception"

I've narrowed it down and it occurs the very first command I try using GDAL:

OSGeo.GDAL.Gdal.SetConfigOption("GDAL_DATA", GDAL_DATA);

I've read in previous threads that it may be related to needing the proper Microsoft Visual C++ Redistributables installed but we've got machines that have 2005, 2008, and 2010 redistributables installed and still no luck.  I've also included the msvcp100.dll and msvcr100.dll files in my install package.

I think we have the problem narrowed down to older machines running XP or Vista.  Beyond that I'm not sure.

Does anyone know of other dependencies I should be trying?

Thanks,

Chris

Chris Pouliot
GIS Application Developer
Minnesota Department of Natural Resources
christopher.pouliot at state.mn.us
(651) 259-5491


_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list