Saddam,
I was able to upgrade your project. I did notice that the code didn't quite compile. I changed some of the code, I have //DAVID: on the line above all of my changes. I am also attaching a screenshot.
What I did was:
1. Unrar the package you sent me.
2. Open the solution
3. Replace the references with the latest 5.5 production released ones. Note that I remove the MapSuiteDesktopEdition, GeoApi, NetTopologySuite, and the MapSuiteCore BUT when I added the references back in I ONLY referenced the MapSuiteCore and the MapSuiteDesktopEdition.
4. Tried to compile but it failed..
5. Fixed a few code things, I commented everything I changed in the code below
6. It compiled and ran fine.
7. I went into the projects properties and changed the target profile to 4.0
8. I did a Clean on the project
9. I rebuilt the project without errors
10. It ran fine..
private void Form1_Load(object sender, EventArgs e)
{
// Set the Map Unit. The reason for setting it to DecimalDegrees is that is what the shapefile’s unit of measure is inherently in.
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
//DAVID: I removed the line below.
// winformsMap1.CanvasGeoBrush = new GeoLinearGradientBrush(Rect, GeoColor.GeographicColors.Ocean1, GeoColor.GeographicColors.Ocean2, GeoLinearGradientMode.ForwardDiagonal);
// We create a new Layer and pass the path to a Shapefile into its constructor.
//DAVID: I changed this to path to where I have the data.
worldLayer = new ShapeFileFeatureLayer(@"C:\Program Files (x86)\ThinkGeo\Map Suite Desktop Full Edition 5.5\Samples\SampleData\Data\Countries02.shp");
worldLayer.IsVisible = true;
// Set the worldLayer with a preset Style, as AreaStyles.Country1 has YellowGreen background and black border, our worldLayer will have the same render style.
//DAVID: I change the zoom level 10 to 01 so we could see something when we pulled it up
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
// This setting will apply from ZoonLevel01 to ZoomLevel20, that means we can see the world the same style with ZoomLevel01 all the time no matter how far we zoom out/in.
//DAVID: I change the zoom level 10 to 01 so we could see something when we pulled it up
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
worldLayer.Open();
// Create a new Layer Overlay to hold the layer we just created
LayerOverlay layer1 = new LayerOverlay();
// Add the shapefile layer to the layer overlay
layer1.Layers.Add(worldLayer);
// We need to add the layer overlay to Map.
winformsMap1.Overlays.Add(layer1);
// Set a proper extent for the Map.
//winformsMap1.CurrentExtent = new RectangleShape(0, 78, 30, 26);
worldLayer.Close();
// We now need to call the Refresh() method of the Map control so that the Map can redraw based on the data that has been provided.
winformsMap1.Refresh();
}
David