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

Daniel Walton dgwalton at gmail.com
Fri Oct 2 10:31:59 PDT 2009


More pre-apologies for the 101 type questions I'm asking here. Thanks for
the replies. You were all right, I just had to check all the dll
dependencies and copy those into my bin folder (32 dlls in all). Now I am
one inch further down the road. I can create the mapfile (text shown below),
but how to I get from mapfile to hosted WMS? I will break down the question
into the parts I can see so far (please add or subtract if I'm off):

   1. Do I need to create the mapfile in a specific folder for MapServer to
   'see' it?
   2. Are there any other configuration files that need to be created or
   edited for MapServer to expose my map via WMS?
   3. Can the files in (2) be created/edited via MapScript?
   4. What would be the base URL of the WMS once it's running?

Thanks again for your patience in holding my hand for these baby steps!

Mapfile currently being created at R:\Temp\A091002122006.map:

*MAP
  EXTENT -1 -1 -1 -1
  IMAGECOLOR 255 255 255
  IMAGETYPE gif
  SIZE -1 -1
  STATUS ON
  UNITS METERS
  NAME "MS"

  OUTPUTFORMAT
    NAME "gif"
    MIMETYPE "image/gif"
    DRIVER "GD/GIF"
    EXTENSION "gif"
    IMAGEMODE "PC256"
    TRANSPARENT FALSE
  END

  LEGEND
    IMAGECOLOR 255 255 255
    KEYSIZE 20 10
    KEYSPACING 5 5
    LABEL
      SIZE MEDIUM
      TYPE BITMAP
      BUFFER 0
      COLOR 0 0 0
      FORCE FALSE
      MINDISTANCE -1
      MINFEATURESIZE -1
      OFFSET 0 0
      PARTIALS TRUE
    END
    POSITION LL
    STATUS OFF
  END

  QUERYMAP
    COLOR 255 255 0
    SIZE -1 -1
    STATUS OFF
    STYLE HILITE
  END

  SCALEBAR
    ALIGN CENTER
    COLOR 0 0 0
    IMAGECOLOR 255 255 255
    INTERVALS 4
    LABEL
      SIZE MEDIUM
      TYPE BITMAP
      BUFFER 0
      COLOR 0 0 0
      FORCE FALSE
      MINDISTANCE -1
      MINFEATURESIZE -1
      OFFSET 0 0
      PARTIALS TRUE
    END
    POSITION LL
    SIZE 200 3
    STATUS OFF
    STYLE 0
    UNITS MILES
  END

  WEB
    IMAGEPATH ""
    IMAGEURL ""
    QUERYFORMAT text/html
    LEGENDFORMAT text/html
    BROWSEFORMAT text/html
  END

  LAYER
    DATA
"R:\Temp\A091002122006_output\A091002122006_PROCESS_RESULTS\AOI_1_S5_MIS_10m_20080706_EV30004214_Ortho_Basin_Indians_NIR.tif"
    NAME "AOI_1_S5_MIS_10M_20080706_EV30004214_ORTHO_BASIN_INDIANS_NIR"
    STATUS ON
    TYPE RASTER
    UNITS METERS
  END

  LAYER
    DATA
"R:\Temp\A091002122006_output\A091002122006_PROCESS_RESULTS\AOI_1_S5_MIS_10m_20080706_EV30004214_Ortho_Basin_Indians_RATIO.tif"
    NAME "AOI_1_S5_MIS_10M_20080706_EV30004214_ORTHO_BASIN_INDIANS_RATIO"
    STATUS ON
    TYPE RASTER
    UNITS METERS
  END

  LAYER
    DATA
"R:\Temp\A091002122006_output\A091002122006_PROCESS_RESULTS\AOI_1_S5_MIS_10m_20080706_EV30004214_Ortho_Basin_Indians_SWIR.tif"
    NAME "AOI_1_S5_MIS_10M_20080706_EV30004214_ORTHO_BASIN_INDIANS_SWIR"
    STATUS ON
    TYPE RASTER
    UNITS METERS
  END

  LAYER
    DATA
"R:\Temp\A091002122006_output\A091002122006_PROCESS_RESULTS\AOI_1_S5_MIS_10m_20080706_EV30004214_Ortho_Basin_Indians_Hot_Spots.tif"
    NAME
"AOI_1_S5_MIS_10M_20080706_EV30004214_ORTHO_BASIN_INDIANS_HOT_SPOTS"
    STATUS ON
    TYPE RASTER
    UNITS METERS
  END

  LAYER
    DATA
"R:\Temp\A091002122006_output\A091002122006_PROCESS_RESULTS\AOI_1_S5_MIS_10m_20080706_EV30004214_Ortho_Basin_Indians_FIRE_HIGHLIGHT.tif"
    NAME
"AOI_1_S5_MIS_10M_20080706_EV30004214_ORTHO_BASIN_INDIANS_FIRE_HIGHLIGHT"
    STATUS ON
    TYPE RASTER
    UNITS METERS
  END

END*





On Fri, Oct 2, 2009 at 10:12 AM, Tamas Szekeres <szekerest at gmail.com> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091002/df028b65/attachment.htm>


More information about the MapServer-users mailing list