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 <[EMAIL PROTECTED]>:
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,
