Csharp/MapScript

Abe Gillespie abe.gillespie at GMAIL.COM
Thu Nov 17 17:12:52 EST 2005


I believe that even keeping objects lifetime bound to requests isn't
enough.  AFAIK multiple threads can get involved in a single page
request.  It's really not pretty at all.  One might have better luck
in Mono's ASP.NET implementation.

-Abe

On 11/17/05, Tamas Szekeres <szekeres.tamas at freemail.hu> wrote:
> Abe, Ian
>
> I am not too far with this issue (I would be helpful if anyone could
> describe that in more detail), but I suppose not to maintain mapscript
> objects between requests, and also call dispose on the same function where
> the object was created.
>
> One should consider mapscript classes as thread unsafe.
>
> Tamas
>
>
> On Thu, 17 Nov 2005 13:18:33 -0700, Ian Erickson <ierickson at ANALYGIS.COM>
> wrote:
>
> >I'd like to know the answer to this as well...are there things that we
> >can do that would promote thread safety - like building MapServer
> >without GDAL support?
> >
> >- Ian
> >
> >Abe Gillespie wrote:
> >
> >>Tamas,
> >>
> >>Isn't there still tremendous threading issues that cause endless
> >>problems when hosted in ASP.NET?  Or has that been solved ... or have
> >>people found work-arounds?
> >>
> >>Thanks.
> >>-Abe
> >>
> >>On 11/17/05, Tamas Szekeres <szekeres.tamas at freemail.hu> wrote:
> >>
> >>
> >>>I recommend to compile mapserver and the related libraries for yourself
> >>>before using them with ASP.NET. It is highly suggested to use the same
> >>>compiler version for theese packages (eg VS 2003).
> >>>
> >>>The Win32 compilation instructions can be found at:
> >>>
> >>>http://mapserver.gis.umn.edu/doc46/win32_compile-howto.html
> >>>
> >>>to compile use Visual Studio .NET Command Prompt and nmake.
> >>>
> >>>To compile mapscript:
> >>>
> >>>1. download the latest SWIGWin package which contains the Win32 binary
> >>>SWIG.EXE
> >>>
> >>>2. edit nmake.opt for referring to the SWIG location
> >>>
> >>>3. In Visual Studio .NET Command Prompt cd to mapscript/csharp
> >>>
> >>>4. nmake -f makefile.vc
> >>>
> >>>To test the compilation
> >>>
> >>>5. Create an empty ASP.NET C# project
> >>>
> >>>6. Add reference to the previously compiled mapscript_csharp.dll
> >>>
> >>>6. Use the following code to test the map creation
> >>>
> >>>private void Page_Load(object sender, System.EventArgs e)
> >>>{
> >>>// Put user code to initialize the page here
> >>>        using (mapObj map = new mapObj(@"C:\Maps\MapFiles\mymap.map"))
> >>> {
> >>>    using(imageObj image = map.draw())
> >>>    {
> >>>  byte[] img = image.getBytes();
> >>>  Response.BinaryWrite(img);
> >>>    }
> >>> }
> >>>}
> >>>
> >>>7. Before testing the project make sure that all of the dlls (depending
> on
> >>>the mapserver compiler options, eg: bgd.dll, gdal13.dll, libcurl.dll,
> >>>libmap.dll, mapscript.dll, mapscript_csharp.dll, proj.dll) reside in the
> >>>correct location. I recommend to place the dll-s to the same directory
> as
> >>>your target file.
> >>>
> >>>
> >>>
> >>>Best Regards,
> >>>
> >>>Tamas Szekeres
> >>>
> >>>
> >>>On Tue, 15 Nov 2005 13:08:06 -0600, Suman G. Pradhan
> >>><sgp_dgtek at HOTMAIL.COM> wrote:
> >>>
> >>>
> >>>
> >>>>Dear all
> >>>>Please some one help me finding Csharp/MapScript.
> >>>>Why there is no resources related with MapServer and .Net ?
> >>>>
> >>>>
> >>
> >>
> >>
>



More information about the mapserver-users mailing list