[mapserver-users] Re: Mapscript c# VS 2010 framework 4 and memory leaks

James Perrins james.perrins at gmail.com
Wed Apr 21 19:47:48 EDT 2010


Hi Tamas,

Thanks for that - and for all your efforts maintaining these.
I'm a bit up against it needing the 32 bit version for VS 2010 for
some demos.  I grabbed the source, and complied it in VS 2010 (just
changing the makefile so that it recognised 10.x as a valid platform)

Things seemed to compile - but when I call something like
mapObj(MyMapFile) I get an error about

"Attempt by security transparent method
'OSGeo.MapServer.mapObj..ctor(System.String)' to call native code
through method 'OSGeo.MapServer.mapscriptPINVOKE.new_mapObj(System.String)'
failed.  Methods must be security critical or security safe-critical
to call native code."

Is this because there is more stringent security with Framework 4, or
has my compilation not been as successful as I hoped.
Do you know of a quick fix to get me over this until you get a chance
to build the new libraries (e.g. making it full trust or something)?

Many Thanks
James
P.S. Apologies if this arrives twice - but I got a bounce from the listserver

On Wed, Apr 21, 2010 at 8:47 PM, Tamas Szekeres <szekerest at gmail.com> wrote:
> Hi James,
>
> I'm planning to exend http://vbkto.dyndns.org:1280/sdk with VS2010
> builders, however it may require 1-2 weeks for me to compile all the
> dependencies with VS2010 for Win32 and Win64.
>
> Best regards,
>
> Tamas
>
>
>
> 2010/4/21 James Perrins <james.perrins at gmail.com>:
>> Hi,
>>
>> I've been struggling with memory errors doing fairly simple things
>> (e.g. mapObj not populating properly - I could normally render a map
>> image - but not work with the layers for example).
>>
>> This was in VS 2010 targeting .NET framework 4 - all appeared to work
>> OK - in fact all did work OK within visual studio - but started to
>> fall apart when run directly from a compiled exe.
>>
>> I tried a range of DLLs (including last stable version from
>> http://vbkto.dyndns.org:1280/sdk/index.html) and used dependency
>> walker to check all was in place.
>>
>> As a test I moved everything back to VS 2008 / 3.5 and it all worked -
>> so I can only assume that maybe I need to get a version of teh
>> MapScript c# dll built for framework 4 - does this make sense?
>>
>> I would dearly love to stay with 3.5 - but unfortunately we need a new
>> component from 4.0
>>
>> Can anyone point me at a dll compiled for .NET 4 - or reassure me taht
>> is should be relatively simple for me to tackle from the source!
>>
>> Many Thanks
>> James
>>
>


More information about the mapserver-users mailing list