<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Trebuchet MS";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Trebuchet MS";
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 115.65pt 1.0in 115.6pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>I ended up with all the DLLs in the output dir for my
winapp. And still had problems until Tamas provided me with a &quot;built for
.NET 2.0&quot; set of stuff.<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>I've got a test app that I passed around with Tamas
that I think has everything you need in it to get working.<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>I added a comment to the Mapserver Wiki at:<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><a
href="http://mapserver.gis.umn.edu/docs/howto/mapscriptcscompile/howto_view">http://mapserver.gis.umn.edu/docs/howto/mapscriptcscompile/howto_view</a><o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>This has a link to download the test app that Tamas
helped me get working. <o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt;color:navy'>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.<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>Good luck!<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>David Lowther<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>-----Original Message-----<br>
From: Tamas Szekeres [mailto:szekerest@GMAIL.COM] <br>
Sent: Monday, August 28, 2006 4:52 PM<br>
Subject: Re: Using CSharp Mapscript with VS2005 and .NET 2.0</span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>Hi,<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>This kind of problem might be dedicated to missing
libraries<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>referenced by the mapscript package. You might want to
use<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>sysinternal's filemon or a similar tool to detect the
dll-s could not<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>be loaded. I suggest to place all the dll-s into your
application<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>directory (where mapscript.dll and
mapscript_csharp.dll resides)<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>You should also recompile mapserver and mapscript with
VS2005 to make<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>sure mapscript_csharp.dll targets the MS.NET FW 2.0 instead
of 1.1.<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>The windows buildkit is the best choice to have all
the files needed<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>for the compilation<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>http://hobu.stat.iastate.edu/mapserver/build_output/<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>Best Regards,<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>Tamas<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>2006/8/28, Jim Bartol &lt;jbartol@mmm.com&gt;:<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; I have been experimenting with the latest version
of MS4W V2.1 via a web<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; browser, and learning some of the basics about
how MapServer works.&nbsp; I am<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; now trying to use CSharp Mapscript to access
MapServer directly from a<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; WinForms application.&nbsp; I understand that the
MS4W binaries have been<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; compiled for .NET 1.1, and that there are some
issues with running them<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; against .NET 2.0 as described in<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt;
http://mapserver.gis.umn.edu/docs/howto/mapscriptcscompile.&nbsp; My<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; *.exe.manifest file shows a reference to the CRT
as described in section<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; 3.1 of this website, but I still get a runtime
error &quot;The type initializer<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; for 'mapscriptPINVOKE' threw an exception&quot;
when creating an instance of a<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; MapServer object (e.g., mapObj map = new
MapObj(&quot;mapfile.map&quot;).&nbsp; Both<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; mapscript.dll and mapscript_csharp.dll are in my
bin/debug directory.<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; I came across a previous post from David Lother
who may have worked through<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; a similar problem.&nbsp; Any suggestions as to
what I might be missing in<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; regards to building a WinForms app with CSharp
Mapscript?&nbsp; Could there be<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; something I've overlooked regarding manifest
files?&nbsp; Can I use MS4W V2.1<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; with .NET 2.0, or should I rebuild the binaries
using the VS2005 compiler?<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt; Thanks for any help you can provide,<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 color=navy face="Trebuchet MS"><span
style='font-size:10.0pt'>&gt;<o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>