[mapserver-users] Type initializer exception with C# MapScript

Tamas Szekeres szekerest at gmail.com
Fri Oct 2 08:12:58 PDT 2009


2009/10/2 Daniel Walton <dgwalton at gmail.com>:
> Hey guys,
>
> I'm new to MS, and using the MS4W distribution. It was the only Windows
> binary dist. I found that had C# MapScript set up.

Daniel,

That's not exactly the case, you could also use the binaries available
at this location:
http://vbkto.dyndns.org/sdk/

FWTools (http://fwtools.maptools.org/) should also have the C#
bindings included.


Anyway, I get the
> following exception when I try to construct a mapObj:
>
> The type initializer for 'OSGeo.MapServer.mapscriptPINVOKE' threw an
> exception.
>
> Anyone else out there seen this?
>
>
> I have referenced mapscript_csharp.dll compiled by the MS4W folks, and here
> is the properties pane in VS2008:
>

Yes, most of the users have ever seen that, which would normally mean
that not all of the dll-s are available to load when your application
is running.
Make sure all of the required dependecies (like mapscript.dll,
libmap.dll, gdal geos dll-s etc.) are available in your executing
directory.
You may also use a file monitoring tool (like Sysinternals filemon) to
identify the expected location of the files at run-time.




Best regards,

Tamas



More information about the MapServer-users mailing list