Problems w/ MapScript C#

Holger Flörke floerke at DOCTRONIC.DE
Thu Apr 7 04:58:21 EDT 2005


What flag should add to nmake.opt to enable thread support within the win32
mapserver? I saw the compiler Flag USE_THREAD, but is it sufficient?

Why is the thread-support off at default?

Sean Gillies schrieb:

> On Apr 6, 2005, at 3:59 PM, Morten Nielsen wrote:
>
>>> I've successfully built the C# Mapscript assembly, and have
>>> successfully
>>> written code that generates an image file to disk.  Everything seems
>>> to
>>> work just fine until I make repeated calls to the map.draw() function.
>>> I get the following exception after 3 or 4 calls to the private member
>>> function drawMapImage():
>>
>>
>>> System.NullReferenceException: Object reference not set to an instance
>>> of an object.
>>>   at mapscriptPINVOKE.mapObj_draw(IntPtr jarg1)
>>>   at mapObj.draw()
>>>   at SimpleMap.Form1.drawMapImage()
>>
>>
>> I have lately experienced the same problem that Ian has. It seems that
>> the
>> C#/SWIG mapscript is very unstable, no matter whether it's a Windows
>> Application or a web application. Some times it works, sometimes it
>> don't.
>> Sometimes it always works on one machine, but never on another. And
>> sometimes it even crashes the IIS process. I wonder if this also
>> occurs on
>> the Mono-based assemblies.
>>
>> The C# support in SWIG is pretty new, so it could be a SWIG bug, but I
>> wasn't ably to find any that apply in their bug-tracking. Perhaps we
>> should
>> better start looking at the SWIG implementation, although I really
>> wouldn't
>> know where to begin; especially because it's so hard to debug.
>>
>> Pointers to get me started on this are highly appreciated.
>>
>> /Morten Nielsen
>>
>
> My impression is that you may be getting ahead of yourselves a bit with
> your SimpleMap and Form classes.  Let's back up a bit.  Make the
> simplest possible mapscript application, and then run the web app under
> your debugger to find out what the problem actually is.  If you can't
> debug your website, perhaps try with some sort of lightweight
> multithreading HTTP server.  The .NET platform must have something like
> this.
>
> That said, now I am going to take a wild swing :)  Any chance that
> you've overlooked building in the win32 thread support from
> mapthread.c?  It's off by default in MapServer's windows makefile and
> never really mentioned in any of the win32 installation docs.
>
> Sean
>
> --
> Sean Gillies
> sgillies at frii dot com
> http://users.frii.com/sgillies
>

--
holger floerke                      d  o  c  t  r  o  n  i  c
email floerke at doctronic.de          information publishing + retrieval
phone +49 228 92 682 00             http://www.doctronic.de



More information about the mapserver-users mailing list