[gdal-dev] Re: GDAL - CSharp

Tamas Szekeres szekerest at gmail.com
Fri Mar 6 17:22:38 EST 2009


Hi Tomas,

I don't remember what the exact problem was, however the situation remains
the same, namely:

1. We can compile gdal either for x86 or x64. The x86 version could work
natively with the x86 version on the .NET framework and the x64 compilation
would work with the x64 version of the framework.
2. If the host process is developed by you, then you should use the
/platform:x86 compiler optionand use the gdal x86 compilation. This setting
will provide to force your application to run on x86 mode regardless of the
environment which will work pretty well on each platform then.
3. ASP.NET application running on a Win64 OS  use the x64 framework by
default, therfore you'll have to use the Win64 compiled gdal binaries.
However this is not the case when running the same application in the VS
debugger since the debugger host process is running in x86 mode by default.

Best regards,

Tamas





2009/3/6 Tomas R <monshi at home.se>

> Tamas, remember the detective work done last year.
>
> 32 bit C# interface won't mix at all with 64 bit runtime environment. or
> have you found a way around that? have not followed the list for some time,
> just now trying to create a 64-bit version of gdal.
>
> Yes, I have a problem too, and yes a q has been posted on this list.
>
> /Tomas
>
> Tamas Szekeres skrev:
>
>> You should provide further info about your environment:
>>
>> 1. Did you test your app by running from an IDE like VS2005 for example?
>> 2. What version of OS/IIS you intend to use when deploying the
>> application.
>>
>> You appdir and platform configuration (32/64) may be different depending
>> on your environment.
>> For example by using the VS IDE you'd probably use WebDev.WebServer.exe as
>> the host process which is running against the 32 bit version of the .NET
>> framework on a 64 bit machine.
>>
>> You might want to use SysInternals ProcMon.exe to make sure about the
>> expected locations of the dll files.
>>
>> Best regards,
>>
>> Tamas
>>
>>
>>
>>
>> 2009/2/12 Tri <rsosnowski at cableone.net <mailto:rsosnowski at cableone.net>>
>>
>>
>>    Tamas,
>>
>>    I'm creating web services.  This is first go on 64 bit machine -
>>    plenty of
>>    32 bit web services to fall back on.  The problem is I was using
>>    FDO which
>>    as far as I know has only 32 bit compiled code.  So I set the
>>    'Enable 32 Bit
>>    Application' to true, published the application, then tried to run
>>    from
>>    localhost.  There were no problems with 64 bit, 32 bit conflicts
>>    this way.
>>    However, I then started getting an error that says:
>>
>>    System.IO file not found.   I'm not using System.IO file in the
>>    web service.
>>
>>    So, I thought I would use your compiled 64 bit GDAL / OGR code to
>>    create a
>>    new web service, but running into previously mentioned problem
>>    taking this
>>    approach.
>>
>>    Thanks again.....
>>
>>
>>
>>
>>
>>
>>    Tamas Szekeres wrote:
>>    >
>>    > What kind of application you develop  Console/WinForms/ASP.NET
>>    <http://ASP.NET> ?
>>    > Wouldn't it be sufficient to use 32 bit binaries and compile
>>    your app with
>>    > the /platform:x86 option?
>>    >
>>    > Best regards,
>>    >
>>    > Tamas
>>    >
>>    >
>>    >
>>    >
>>    > 2009/2/12 Tri <rsosnowski at cableone.net
>>    <mailto:rsosnowski at cableone.net>>
>>
>>    >
>>    >>
>>    >> Hi Tamas and others - thanks for the help.
>>    >>
>>    >> By application executing directory - I've copied the files to
>>    both the
>>    >> bin
>>    >> directory under the project and the obj, Debug directory under the
>>    >> project.
>>    >> When I run the application in debug mode, the same problem occurs:
>>    >>
>>    >> System.TypeInitializationException:   The type initializer for
>>    >> OSGeo.OGR.Ogr
>>    >> threw an exception
>>    >>
>>    >> InnerException:   The type initializer for OSGeo.OGR.OgrPINVOKE
>>    threw an
>>    >> excpetion
>>    >>
>>    >> I am using the 64 bit compiled code from you on Vista 64 bit
>>    machine.
>>    >>
>>    >> Any more ideas?  Thanks.....
>>    >>
>>    >>
>>    >>
>>    >> Tamas Szekeres wrote:
>>    >> >
>>    >> > Hi,
>>    >> >
>>    >> > You might have to copy all of the dll-s (*_csharp.dll,
>>    *_wrap.dll,
>>    >> > gdal16.dll, proj.dll etc.) to the application executing
>>    directory.
>>    >> >
>>    >> > Best regards,
>>    >> >
>>    >> > Tamas
>>    >> >
>>    >> >
>>    >> >
>>    >> > 2009/2/11 Tri <rsosnowski at cableone.net
>>    <mailto:rsosnowski at cableone.net>>
>>    >> >
>>    >> >>
>>    >> >> Can't get GDAL / OGR to work with CSharp.  Using the CSharp
>>    dlls, I
>>    >> keep
>>    >> >> getting exceptions like:
>>    >> >>
>>    >> >> OgrPINVOKE, threw an exception.
>>    >> >>
>>    >> >>
>>    >> >> TO TRY TO GET TO WORK I DID:
>>    >> >> - Copied the csharp dlls into project,
>>    >> >> - Created a reference to the dlls.
>>    >> >>
>>    >> >> What am I doing wrong?
>>    >> >>
>>    >> >>
>>    >> >> --
>>    >> >> View this message in context:
>>    >> >> http://n2.nabble.com/GDAL---CSharp-tp2308674p2308674.html
>>    >> >> Sent from the GDAL - Dev mailing list archive at Nabble.com.
>>    >> >>
>>    >> >> _______________________________________________
>>    >> >> gdal-dev mailing list
>>    >> >> gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
>>    >> >> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>    >> >>
>>    >> >
>>    >> > _______________________________________________
>>    >> > gdal-dev mailing list
>>    >> > gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
>>    >> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>    >> >
>>    >>
>>    >> --
>>    >> View this message in context:
>>    >> http://n2.nabble.com/GDAL---CSharp-tp2308674p2312047.html
>>    >> Sent from the GDAL - Dev mailing list archive at Nabble.com.
>>    >>
>>    >> _______________________________________________
>>    >> gdal-dev mailing list
>>    >> gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
>>    >> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>    >>
>>    >
>>    > _______________________________________________
>>    > gdal-dev mailing list
>>    > gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
>>    > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>    >
>>
>>    --
>>    View this message in context:
>>    http://n2.nabble.com/GDAL---CSharp-tp2308674p2312090.html
>>    Sent from the GDAL - Dev mailing list archive at Nabble.com.
>>
>>    _______________________________________________
>>    gdal-dev mailing list
>>    gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
>>    http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090306/7fa2b780/attachment.html


More information about the gdal-dev mailing list