[gdal-dev] Issue with SetConfigOption

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Issue with SetConfigOption

Pouliot, Christopher (DNR)
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
[hidden email]
(651) 259-5491


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue with SetConfigOption

Tamas Szekeres
What is the exception message specifically?

Best regards,

Tamas


2012/3/19 Pouliot, Christopher (DNR) <[hidden email]>
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
[hidden email]
<a href="tel:%28651%29%20259-5491" value="+16512595491">(651) 259-5491


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

RE: Issue with SetConfigOption

Pouliot, Christopher (DNR)
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:[hidden email]]
Sent: Monday, March 19, 2012 11:29 AM
To: Pouliot, Christopher (DNR)
Cc: [hidden email]
Subject: Re: [gdal-dev] Issue with SetConfigOption

What is the exception message specifically?

Best regards,

Tamas

2012/3/19 Pouliot, Christopher (DNR) <[hidden email]>
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
[hidden email]
(651) 259-5491


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev