[mapserver-users] Mapscript c# problem with multiple instances

James Perrins james.perrins at gmail.com
Fri Sep 24 11:19:26 EDT 2010


Hi,

mapscript_csharp - 32 bit version 1.0.3679.25032 dated 10/1/2010
All supporting DLLs from Tamas' nightly build site (was last stable
version when I grabbed it in January)
.NET 3.5

Actually using this in desktop winform app.  All has been working
fine, until I just tried to move the map rendering into a background
thread to stop locking up the UI.

No matter what I try - this seems to cause my app to crash out of the
background thread (with no error)
Crash always occurs at the point where I first try and do something
with the OSGeo.MapServer.mapObj
Initially it was when I tried to draw the map (having passed in a map object)
So I then tried reading the map file again from the disk (so nothing
was passed in) - in this case it fails when trying to create the map
object from the map file.
I tried extracting the code to a separate DLL (with only text strings
passed in and out) - this still failed
I then tried to run it as a separate AppDomain - which also failed.

The only way I have it working to to actually call a separate exe
using a temp .map file with my map state and having the exe write the
image file back to disk for my main app to pick up.
This does work - but seems rather a hack.

Am I doing something wrong here / misunderstanding something ?  It
seems almost as if I can only have one map object per application - or
they are trampling on each other in some way I don't understand.

Any ideas ?

Thanks
James


More information about the mapserver-users mailing list