This project has moved and is read-only. For the latest updates, please go here.

Erroк compiling

Topics: SharpMap Project, SharpMap v2.0, WinForms Controls
Nov 19, 2012 at 7:40 AM

Hello! I'm sorry for a lot of stupid questions.Successfully included SharpMap.dll and others libraries. Developed the same program from.

VectorLayer map_layer = new VectorLayer("MyMap");
            map_layer.DataSource = new ShapeFile("bin/Debug/UKR_adm0.shp", true);
            map_layer.Style.Fill = new SolidBrush(Color.Green);
            map_layer.Style.Outline = Pens.Black;
            map_layer.Style.EnableOutline = true;
            map_layer.SRID = 4326;

When ctrl+f5 form appears without errors, but after pressing the button, nothing happens.When debugging (f5), after the click event of the button an error: "No valid source files" also is present inscription: "Location is the call stack."What am I doing wrong? The program can not find what that file.

Nov 20, 2012 at 8:24 PM

You are sure the shapefile is there? along with *.dbf and *.shx?

Nov 21, 2012 at 8:01 AM
Edited Nov 21, 2012 at 8:02 AM

I think you should use 

map_layer.DataSource = new ShapeFile("UKR_adm0.shp", true); 

it its located in the Debug-folder since thats the default working-directory... if you haven't changed it in Visual Studio.

Nov 21, 2012 at 1:39 PM

I'm sorry, but that's not what I meant.Do the following:

1. Install .NET 4.0 Full ;

2. Created a new solution WindowsForms;

3. Added references Brutile.dll, SharpMap.dll SharpMapUI.dll and has given all that is in the folder sharpmap-100364\Trunk\SharpMap\bin\Debug.

4. Added component Mapbox on my form.

5. Launched f5;

6. Got errors:

System.TypeLoadException: Could not load type "SharpMap.Geometries.BoundingBox" of assembly "SharpMap, Version=1.0.4702.22690, Culture=neutral, PublicKeyToken=null".   в SharpMap.Forms.MapBox..ctor()   в project.MainForm.InitializeComponent() в c:\Documents and Settings\ephimovr\Мои документы\SharpDevelop Projects\project\MainForm.Designer.cs:строка 39   в project.MainForm..ctor() в c:\Documents and Settings\ephimovr\Мои документы\SharpDevelop Projects\project\MainForm.cs:строка 26   в project.Program.Main(String[] args) в c:\Documents and Settings\ephimovr\Мои документы\SharpDevelop Projects\project\Program.cs:строка 27

When I launch my program with ctrl+f5 error:

"An unhandled win32 exeption occured in project.exe [2080]. Just-in-Time debugging this exeption failed with the following error: No installed debugger has Just-in-time debugging enabled. In Visual Studio, Just-in-Time debugging can be enabled from....."

Help me please. I'm not professional, and i want used this component, because it great! 

I used two programs for develop: VS 2010 Express Edition and SharpDevelop 4.0. Errors are similar everywhere.

Hope for your help! Thank you! 

Nov 21, 2012 at 1:51 PM
Edited Nov 21, 2012 at 2:41 PM

You need to reference GeoAPI, NetTopologySuite and PowerCollections as well.

Nov 21, 2012 at 2:12 PM

I've added them. All that were in the folder. ;(

Nov 21, 2012 at 2:44 PM

If you have not already done so, try adding the following lines in your app.config

  <!-- ... maybe all kinds of stuff -->
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>

Nov 21, 2012 at 3:44 PM

Yahoo!!! :) Compile and run everything without mistakes! Thank you so much!!!! Actually going to use Tile maps, but do not know where to get them. I need Google, Openstreet, etc. 

Thank you for you help! :)