Using CSharp Mapscript with VS2005 and .NET 2.0

David Lowther dlowther at COORDINATESOLUTIONS.COM
Tue Aug 29 09:20:29 EDT 2006


I ended up with all the DLLs in the output dir for my winapp. And still had
problems until Tamas provided me with a "built for .NET 2.0" set of stuff.

 

I've got a test app that I passed around with Tamas that I think has
everything you need in it to get working.

 

I added a comment to the Mapserver Wiki at:

http://mapserver.gis.umn.edu/docs/howto/mapscriptcscompile/howto_view

 

This has a link to download the test app that Tamas helped me get working. 

 

I've also managed to get things working in ASP.NET 2.0 (against all the best
advice of folks regarding thread safety...). Maybe I'll post a test app for
that too sometime.

 

 

Good luck!

 

David Lowther

 

 

 

-----Original Message-----
From: Tamas Szekeres [mailto:szekerest at GMAIL.COM] 
Sent: Monday, August 28, 2006 4:52 PM
Subject: Re: Using CSharp Mapscript with VS2005 and .NET 2.0

 

Hi,

 

This kind of problem might be dedicated to missing libraries

referenced by the mapscript package. You might want to use

sysinternal's filemon or a similar tool to detect the dll-s could not

be loaded. I suggest to place all the dll-s into your application

directory (where mapscript.dll and mapscript_csharp.dll resides)

 

You should also recompile mapserver and mapscript with VS2005 to make

sure mapscript_csharp.dll targets the MS.NET FW 2.0 instead of 1.1.

The windows buildkit is the best choice to have all the files needed

for the compilation

 

http://hobu.stat.iastate.edu/mapserver/build_output/

 

 

Best Regards,

 

Tamas

 

 

2006/8/28, Jim Bartol <jbartol at mmm.com>:

> I have been experimenting with the latest version of MS4W V2.1 via a web

> browser, and learning some of the basics about how MapServer works.  I am

> now trying to use CSharp Mapscript to access MapServer directly from a

> WinForms application.  I understand that the MS4W binaries have been

> compiled for .NET 1.1, and that there are some issues with running them

> against .NET 2.0 as described in

> http://mapserver.gis.umn.edu/docs/howto/mapscriptcscompile.  My

> *.exe.manifest file shows a reference to the CRT as described in section

> 3.1 of this website, but I still get a runtime error "The type initializer

> for 'mapscriptPINVOKE' threw an exception" when creating an instance of a

> MapServer object (e.g., mapObj map = new MapObj("mapfile.map").  Both

> mapscript.dll and mapscript_csharp.dll are in my bin/debug directory.

> 

> I came across a previous post from David Lother who may have worked
through

> a similar problem.  Any suggestions as to what I might be missing in

> regards to building a WinForms app with CSharp Mapscript?  Could there be

> something I've overlooked regarding manifest files?  Can I use MS4W V2.1

> with .NET 2.0, or should I rebuild the binaries using the VS2005 compiler?

> 

> Thanks for any help you can provide,

> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060829/8fe36571/attachment.html


More information about the mapserver-users mailing list