Displaying in a C# form, missed .net4 config

Topics: Windows Forms
Jul 11, 2011 at 12:19 PM

I'm sure that this is probably tedious for those of you who have figured out how to implement GMap. But it seems that I haven't caught it yet.  Here is my setup:

References: GMap.NET.Core, GMap.NET.WindowsForms.

Target Frame work:

My Application Setting: .Net Framework 4

GMap.NET.Core .Net Framework 2.0....           thought this kinda strange radio man keeps telling users to check framework is 4.0

This is what the source looks like right now and I'm not getting anything to show.  Could someone help me out.

GMap.NET.WindowsForms .Net Framework 2.0.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GMap.NET;

namespace GoogleTestWinForm
{
    public partial class Form1 : Form
    {
        GMap.NET.MapType m_MapType;
        GMap.NET.PointLatLng m_PointLatLng;
        GMap.NET.PositionChanged OnCurrentPositionChanged;
        public Form1()
        {
            InitializeComponent();
            m_GoogleMap.SuspendLayout();
            m_GoogleMap.Dock = DockStyle.Fill;
            m_GoogleMap.MouseWheelZoomType = GMap.NET.MouseWheelZoomType.MousePositionAndCenter;
            m_MapType = MapType.MapsLT_Map;
            m_GoogleMap.MaxZoom = 11;
            m_GoogleMap.MinZoom = 1;
            m_GoogleMap.Zoom = m_GoogleMap.MinZoom + 1;
            m_PointLatLng = new PointLatLng(54.6961334816182, 25.2985095977783);
            m_GoogleMap.ResumeLayout();
        }
    }
}

Comment RadioMan:

I will help with the documentation on this.  IE a word document that you can us here.  I'll have questions from time to time about why and so one but well get it documented.  Thanks

Gregg

Jul 11, 2011 at 12:29 PM

if you target .net4 as is explained in documentation, you must add app config file ;} new version doesn't require it anymore, so you may try it

Jul 11, 2011 at 12:32 PM

I saw what went into the file yes... What is the name of the config file.

Jul 11, 2011 at 12:38 PM

check http://greatmaps.codeplex.com/discussions/261146#post626790 

Jul 11, 2011 at 12:52 PM

Thanks radioman

Added per direction:

<?xml version="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

MainFrame is no longer showing up. Not even hitting Program.Main().

Jul 11, 2011 at 1:16 PM

Rather than add just the references to my code I guess I should have said I added the project for Core and WindowsForms and added those references.

Jul 11, 2011 at 5:22 PM

there is no difference