[mapserver-users] Error using mapscript_csharp.dll in ASP.NET

blackcat18 m18blackcat at hotmail.fr
Thu May 22 03:11:19 PDT 2014


Hi every one,

I am working for the first with mapserver and its mapscript. 

I wrote a test code in C# as follow:

       * protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack) //First access to the map
            {
                System.Diagnostics.Debug.WriteLine("accès à la map");
                //send image stream from MapServer to ibMap
                //ibMap.ImageUrl = "MapStream.aspx?ACTION=INITMAP";
                //initialize controls
                OSGeo.MapServer.mapObj map = new
OSGeo.MapServer.mapObj("C://programme_map//data//csharptutorial.map");
                for (int i = 0; i < map.numlayers; i++)
                {
                    OSGeo.MapServer.layerObj layer = map.getLayer(i);
                    System.Diagnostics.Debug.WriteLine(layer.name);
                   
                }
            }
        }*

And when I run the project i get this error :

An exception of type 'System.TypeInitializationException' occurred in
mapscript_csharp.dll but was not handled in user code

Additional information: The type initializer for
'OSGeo.MapServer.mapscriptPINVOKE' threw an exception.

I do not know how to fix it. I am working with an OS x64 and I have no
warning.

Regards,
mijo



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-using-mapscript-csharp-dll-in-ASP-NET-tp5141842.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the MapServer-users mailing list