Opened 8 years ago

Closed 3 years ago

#5308 closed defect (wontfix)

Using Csharp - Intermittent - OSGeo.GDAL.GdalPINVOKE' exception on first call.

Reported by: charliecolester Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

Using GDAL>>> gdal-110-1600-core.msi Same type of problem on a Windows 7 32 bit and 64 bit machine. The problem occurs at the first call to any gdal routine after the paths and environment variables are set. In this case:

Environment.SetEnvironmentVariable?("PROJ_LIB", projlib); MessageBox?.Show("Final PROJ_LIB= " + projlib);

Here >> OSGeo.GDAL.Gdal.SetConfigOption?("PROJ_LIB", projlib);

This is the error message - "An unhandled exception of type 'System.TypeInitializationException?' occurred in gdal_csharp.dll Additional information: The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception.

This code works sometime on some machines and fails other times. Right now it will work regardless of where the “csharp” dll’s are, but will only work when the GDAL path and Environmental variables are in: C:\Program Files (x86)\GDAL and not in: C:\Users\Charlie\Desktop\RasterTest2\Libraries\GDAL

Attachments (1)

Csharp.pdf (320.5 KB) - added by charliecolester 8 years ago.
Code and directory structure

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by charliecolester

Attachment: Csharp.pdf added

Code and directory structure

comment:1 Changed 3 years ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.