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

Tamas Szekeres szekerest at gmail.com
Thu Apr 22 06:56:45 EDT 2010


The geneated sources should be in /swig/csharp/ogr, /swig/csharp/gdal,
/swig/csharp/osr
However in the final version of the patch, the corresponding interface
files should be updated instead (in /swig/include/csharp), because the
source files are regenared during the build process.

If you find out the desired changes in the generated sources (.cs) I
could help in making the related changes in the SWIG interface files.

Best regards,

Tamas



2010/4/22 James Perrins <james.perrins at gmail.com>:
> Thanks for that - I was looking for a setting like that but failed to find it.
>
> However I'm not sure its the complete solution (as I've tried it and
> still seem to have the same error) - the link you give states that you
> need to still add:
> [assembly: SecurityRules(SecurityRuleSet.Level1)] to your assembly to
> revert to CLR2 transparency.
>
> Unfortunately this
> http://msdn.microsoft.com/en-us/library/dd409253(v=VS.100).aspx states
> that even with the switch set - it doesn’t effect transparency rules -
> which appears to be the breaking change :-(.  I'm assuming code
> changes need to me made to mapscript_csharp rather than any of my code
> consuming it.
>
> If I was going to have a go at adding this into the mapscript_csharp
> wrapper could you give me a pointer to where to look for the source -
> I seem to have compiled it OK - but am having trouble seeing where the
> source is amongst everything else.
>
> Thanks again
> James
>
>
> On Thu, Apr 22, 2010 at 9:29 AM, Tamas Szekeres <szekerest at gmail.com> wrote:
>> 2010/4/22 James Perrins <james.perrins at gmail.com>:
>>>
>>>
>>> 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."
>>>
>>
>> This appears to be due to the different level of the security
>> transparency setting of .NET FW 4.0 vs. the previous versions.
>> I'll require some further testings to find out the desired solution,
>> however you might want to try with the suggestions below:
>> http://blogs.rev-net.com/ddewinter/2009/05/20/opting-out-of-security-changes-in-net-4/
>>
>> Best regards,
>>
>> Tamas
>>
>


More information about the mapserver-users mailing list