build sharpmap v2.0

Topics: SharpMap v2.0
Feb 25, 2009 at 5:55 PM
Hi,

I do not manage how to buid sharpmap v2.0.
I use VS2008 but I do not know VSN software and I do not understand some english expression ( I am a french junior developper).
Can you explain me or build me the last version, please ?

Thank
Winzo
Coordinator
Feb 25, 2009 at 6:25 PM
Hi winzo,
first install Tortoise svn from here http://tortoisesvn.net/downloads (you will need to restart your computer)
then navigate to the directory that you want to create the solution in.
create a new directory.
right click on it and choose the svncheckout options (the text may have been localised in your version)
in the first text box enter : http://sharpmapv2.googlecode.com/svn/trunk
click OK

tortoise will go and get the latest code which should be all that is required, you can then open the sln file as normal and it should build.
The SharpLayers project may not build if you don't have Python installed on your machine (Python is used in a build step to compress javascript) You can disable the project if you do not require it or install python

hth jd
Mar 3, 2009 at 1:59 PM
Thank johndiss,

it works perfectly now ;-)

Winzo
May 6, 2009 at 11:02 AM
I'm having similar issues, installing python will be an issue for me (not impossible but i'll have to jump through lots of red tape so i would rather not have to), disabling the sharplayers project doesn't seem to stop the python script from attempting to be run, is it a build event on a different project?
Coordinator
May 6, 2009 at 11:07 AM
Hi jiim, the python script is run from the SharpLayers project. You can remove the macro by commenting out the following in the sharplayers csproj

<

 

Target Name="BeforeBuild">

 

<

 

Exec Command="$(ProjectDir)OpenLayers\Build\build.py" WorkingDirectory="$(ProjectDir)OpenLayers\Build\" />

 

<

 

Exec Command="$(ProjectDir)OpenLayers\Build\buildUncompressed.py" WorkingDirectory="$(ProjectDir)OpenLayers\Build\" />

 

</

 

Target>

 



but disabling the project should fix it. Are you sure it is the python stuff that is breaking? There are some other macros used to copy dlls around.. cheers jd
May 6, 2009 at 12:03 PM
yes for some reason it didnt pick up the change with clean build, reopening the solution seems to have worked
May 6, 2009 at 10:17 PM
I have installed python.  How does VS2008 know where it is?
May 7, 2009 at 7:57 AM
I just like to add that I came upon a problem checking out SharpmapV2 from http://sharpmapv2.googlecode.com/svn/trunk. This was because of the NTS external which was defined as:
NTS https://nettopologysuite.googlecode.com/svn/branches/v2.0
which caused a login prompt to appear. Since most newcomers probably aren't registered as NTS developers I just want to point out that you have to change the external setting to:
NTS http://nettopologysuite.googlecode.com/svn/branches/v2.0
then it checks out OK

/Jonas
Coordinator
May 7, 2009 at 9:57 AM
Edited May 7, 2009 at 9:58 AM
@poepoe12002 vs2008 doesn't know as such it relies on the extension .py being mapped to python.exe by the os
@kefir Generally the svn external is mapped correctly.. You caught it when I had been checking stuff in a bit over enthusiatically /(carelessly) It should be mapped correctly again..

cheers jd
May 7, 2009 at 2:59 PM
The following is from the SharpMap.Presentation.Web.SharpLayers.csproj :  
<Target Name="BeforeBuild">
  <Exec Command="$(ProjectDir)OpenLayers\Build\build.py WorkingDirectory=$(ProjectDir)OpenLayers\Build\" />
  <Exec Command="$(ProjectDir)OpenLayers\Build\buildUncompressed.py WorkingDirectory=$(ProjectDir)OpenLayers\Build\" />
</Target>
 
The following is my actual path to build.py :
C:\Documents and Settings\dsease89\My Documents\Visual Studio 2008\dotNetGIS\SharpMap_v2.0\SharpLayers\SharpMap.Presentation.Web.SharpLayers\OpenLayers\Build\build.py

Notice the spaces.  I think these are my problem as the build output says :
'C:\Documents' is not recognized as an internal or external command, operable program or batch file.

Should I be using the quotes differently?

By the way, in a command window, the following(quotes added) does get pass the build error.
"C:\Documents and Settings\dsease89\My Documents\Visual Studio 2008\dotNetGIS\SharpMap_v2.0\SharpLayers\SharpMap.Presentation.Web.SharpLayers\OpenLayers\Build\build.py"

TIA, D
 
Coordinator
May 7, 2009 at 3:30 PM
Edited May 7, 2009 at 3:33 PM
Hi again, It probably does require quotes in your situation then.. If you manage to get it working in your environment let me know and I will update the trunk accordingly.. cheers jd
just a thought but does :
 <Target Name="BeforeBuild">
  <Exec Command="&quot;$(ProjectDir)OpenLayers\Build\build.py&quot; WorkingDirectory=$(ProjectDir)OpenLayers\Build\" />
  <Exec Command="&quot;$(ProjectDir)OpenLayers\Build\buildUncompressed.py&quot; WorkingDirectory=$(ProjectDir)OpenLayers\Build\" />
</Target>
work?
May 7, 2009 at 3:31 PM
I have checked out sharpmapv2 revision 673 and built it with Debug_Net20 in VS2008.
 I have one issue in
sharpmapv2\SharpLayers\SharpMap.Presentation.Web.SharpLayers\OpenLayers\Build\build.py", line 15
except Exception, E:
^
SyntaxError: invalid syntax
and one in SharpMap.Demo.SharpLayers
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(539,9): error : The OutputPath property is not set for this project.  Please check to make sure that you have specified a valid Configuration/Platform combination.  Configuration='Debug'  Platform='AnyCPU'

It excluded both projects (SharpMap.Demo.SharpLayers and SharpMap.Presentation.Web.SharpLayers) from the project folder and production is running well.
Afterwards I added a windows forms application (.NET Framework 2.0) and tried to add the MapViewControl (out of the SharpMap.Presentation.WinForms component in the toolbox) to the form:
System.IO.FileNotFoundException: File or Assembly "SharpMap.Rendering.Gdi, Version=2.0.0.0,Culture=neutral,... was not found ... at SharpMap.Presentation.WinForms.MapViewControl..ctor()

Martin
Coordinator
May 7, 2009 at 3:46 PM
@poepoe12002, I have changed the macro slightly can you get latest and give it a go?
@mgeng try doing a full rebuild of the solution

hth jd
May 7, 2009 at 11:22 PM
Just wanted to report where I am now.

I updated SharpMap after your macro changes.

The VS build then exited with code 1.
I found out that python was not in my PATH and solved that.

Then I opend a command window at:
C:\Documents and Settings\dsease89\My Documents\Visual Studio 2008\dotNetGIS\SharpMap_v2.0\SharpLayers\SharpMap.Presentation.Web.SharpLayers\OpenLayers\Build

Then I opened the python shell and typed the following:
>>> import mergejs.py

This was the error:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named py

I wondered about this error and decided to drop the .py just to see what would happen.
So I typed the following:
>>> import mergejs
>>>

No error so I did a build in VS.  No error.  
Don't have a clue as to what this means.  
I'll just look for future errors.