Using GMap.NET in .NET4

Topics: General
Jun 13, 2011 at 8:23 AM


I am a beginner at C# and WPF and would like to use GMap.NET in my own application. I have done the following steps:

1) New C# project, WPF, VS2010, x86.

2) Added reference to GMap.NET.Core.dll, GMap.NET.WindowsPresentation.dll, System.Data.SQLite.dll (x86)

3) Added the control to my toolbox, so i see "GMapControl", "GMapControlNew", and "TilePrefetcher" in my toolbox.

4) Added a new GMapControl object to my window, in a grid.


When I build my application to test, it shows that the GMapControl object loaded, but no imagery. Instead, there are many "Exception: The type initializer for 'SingletonCreator' threw an exception." messages all over the tiled areas. In the background, there are "We are sorry, but we don't have imagery at this zoom level for this region". Setting GMapControl.Zoom to any value between 2 and 17 doesn't seem to help. Will appreciate any advice to point me in the right direction please! Still learning to code so bear with me!

Thank you!

Jun 13, 2011 at 8:31 AM

use AnyCPU target

Jun 13, 2011 at 8:36 AM

Target changed to "Any CPU", result is still the same. I am sorry I think I must be doing something really wrong here! :/

Jun 13, 2011 at 8:43 AM

I have tried adding a configuration file for .NET4 by doing:

1) right-click on project > Add > New Item > Visual C# Application Configuration File

2) changing the configuration file as per

no difference :(

Jun 13, 2011 at 8:45 AM

zip your test project, i'll check the issue

Jun 13, 2011 at 9:00 AM

Thanks! Zipping and send it via email!

Jun 13, 2011 at 9:51 AM

just add this ;}

Jun 13, 2011 at 9:54 AM

OH WOW. Must have added the wrong config file. The first time i changed the config file to some other name. So now it works! Great thanks for your help! :)

Jun 13, 2011 at 9:55 AM

cheers ;}

Jul 11, 2011 at 12:39 PM

p.s. new version doesn't require app config file anymore

Jul 11, 2011 at 12:52 PM
Cool will download and try tomorrow. Thank you so much for the heads up! :)

Sent from my iPhone

On Jul 11, 2011, at 19:39, "radioman"<> wrote:

From: radioman

p.s. new version doesn't require app config file anymore

Feb 1, 2012 at 7:58 AM

Dears, I have the same problem but no result .. when I add the control to the form.. after running the map takes time to display blue quarters containing 


"Exception: the operation has timed out we are sorry but we dont have imagery at this zoom level for this region"


please i need your support .. as I wast lots of time trying to find solution

Feb 1, 2012 at 8:02 AM
Edited Feb 1, 2012 at 8:02 AM

your provider? too high zoom, old version?

Feb 1, 2012 at 8:07 AM

unfortunately.. i'm using the latest version of the GMap.NET.WindowsForms which is v2.0.50727

and this is my code

   public Form1()

            GMapControl MainMap = new GMapControl();
                MainMap.MapProvider = GMapProviders.YahooMap;
                MainMap.Position = new PointLatLng(54.6961334816182, 25.2985095977783);
                MainMap.MinZoom = 1;
                MainMap.MaxZoom = 17;
                MainMap.Zoom = 9;
                MainMap.Dock = DockStyle.Fill;
nothing more .. :(

Feb 1, 2012 at 8:13 AM

did you added both references: GMap.NET.Core.dll && GMap.NET.WindowsForms.dll ?

Feb 1, 2012 at 8:16 AM

yes., GMap.NET.WindowsForms v2.0.50727, GMap.NET.Core v2.0.50727 and  BSE.Windows.Forms v2.0.50727


Feb 1, 2012 at 8:21 AM

you use old version, there is no BSE.Windows.Forms anymore

Feb 1, 2012 at 8:27 AM

could you please send me link of the last version ... 

I have download it from

or what i have to do .. i have deleted the reference of  BSE.Windows.Forms .. but still the same result

Feb 1, 2012 at 8:31 AM

Feb 1, 2012 at 8:41 AM

OMG .. I have realized that the system configuration add proxy to enter the internet .. I have to work around this problem 

Feb 1, 2012 at 8:54 AM

GMapProvider.WebProxy = new WebProxy("", 8080);
GMapProvider.WebProxy.Credentials = new NetworkCredential("", "bilgeada");

Feb 1, 2012 at 10:50 AM

it works , but the rendering of the map is extremely slow :( while the connection speed is so fast

Feb 1, 2012 at 11:43 AM

rendering is as fast as you can get on your machine

Feb 1, 2012 at 12:24 PM

there is more than strange things , 

when I use MainMap.MapProvider = GMapProviders.GoogleMap; it does not work , 

while MainMap.MapProvider = GMapProviders.YahooMap; works


Feb 1, 2012 at 12:31 PM

it works here ;}

Feb 1, 2012 at 12:50 PM

i'm so sorry if I ask lot of questions really thank you for your support but i'd like to know something , 

how can i tied 

GMapProvider.WebProxy = new WebProxy("", 8080);
GMapProvider.WebProxy.Credentials = new NetworkCredential("", "bilgeada");


the gmap control

Feb 1, 2012 at 1:05 PM


Feb 1, 2012 at 1:12 PM

as i see there was something like 

// set your proxy here if need           

MainMap.Instance.Proxy = new WebProxy("", 8080);           

MainMap.Instance.Proxy.Credentials = new NetworkCredential("", "bilgeadam");


MainMap.Manager.Proxy = new WebProxy("", 8080); 

MainMap.Manager.Proxy.Credentials = new NetworkCredential("", "bilgeadam");


to tied the proxy with the MainMap which is the gmap control


but in this version of GMap.NET.Core.dll && GMap.NET.WindowsForms.dll there is no MainMap.Manager.Proxy or MainMap.Instance.Proxy 

Feb 1, 2012 at 1:40 PM


Error 1 'GMap.NET.GMaps' does not contain a definition for 'Proxy' and no extension method 'Proxy' accepting a first argument of type 'GMap.NET.GMaps' could be found (are you missing a using directive or an assembly reference?) D:\GoogleMapPlanningTool\GoogleMapPlanningTool\Form1.cs 42 33 GoogleMapPlanningTool

Feb 1, 2012 at 1:42 PM

sorry, GMapProvider.WebProxy

Feb 1, 2012 at 1:50 PM

ok great i used 

GMapProvider.WebProxy = new WebProxy("", 8080);
GMapProvider.WebProxy.Credentials = new NetworkCredential("", "bilgeada");

but what is relation between GMapProvider and MainMap , there is nothing to connect the MainMap  control with GMapProvider

Feb 1, 2012 at 1:52 PM

 public Form1()
            GMapProvider.WebProxy = new WebProxy("", 8080);
            GMapProvider.WebProxy.Credentials = new NetworkCredential("", "bilgeada");

            MainMap = new GMapControl();
                 MainMap.MapProvider = GMapProviders.GoogleMap;
                MainMap.Position = new PointLatLng(27.6961334816182, 30.2985095977783);
                MainMap.MinZoom = 1;
                MainMap.MaxZoom = 17;
                MainMap.Zoom = 7;
                MainMap.CanDragMap = true;
                MainMap.Dock = DockStyle.Fill;
GMapProvider is not assiend to MainMap .. that's what i mean 

Feb 1, 2012 at 2:06 PM

you've set faked address and credentials, it will not work

Feb 1, 2012 at 2:09 PM

you mean faked address >>

faked credentials>> "", "bilgeada"


Feb 1, 2012 at 2:13 PM

Ofcourse ;}

Feb 1, 2012 at 2:16 PM

i'm so sorry but from where can i get the right ones?

Feb 1, 2012 at 2:21 PM

"OMG .. I have realized that the system configuration add proxy to enter the internet .. I have to work around this problem " its your proxy, how do i know ;}

Feb 1, 2012 at 2:36 PM

Thank You sooooooooooooooooooo much :) 

really you are Great Person ... Thank you for your amazing support :)

Feb 1, 2012 at 2:41 PM

;} anytime, anywhere

Feb 1, 2012 at 2:57 PM

Thank you :)

the last question , it there a way to add 1000s marker or icons in the map without killing the performance ?

Feb 1, 2012 at 3:03 PM

check the flight demo, it handles > 1000 markers quite good

Feb 2, 2012 at 10:12 AM

mmm .. really i dont understand what  flight demo is? and how it works :(

Feb 2, 2012 at 11:41 AM

not my problem ;}

Feb 2, 2012 at 11:48 AM


Feb 27, 2012 at 3:16 PM

hi, i'm currently working desktop app using gmapcontrol and i can't drag it. Can you help me to solve this problem pls? 

Feb 27, 2012 at 3:18 PM

default drag button is right

Feb 27, 2012 at 3:51 PM
Edited Feb 28, 2012 at 3:41 AM

oh, thanks. it works :)


Mar 15, 2012 at 2:53 AM


I am looking to do a particular thing and I wanted an expert's advice in knowing if Gmap.Net is the right thing to use. 

What I need to do is this - 

Have the user select certain filtering criteria from dropdown (this runs queries on the database and generates XML resultsets). Then depending on what criteria the user has selected, render that particular XML onto the map. Then if the user hovers over a particular state, the data for that particular state (in that resultset) will be displayed in a balloon. 

Please help me. Its an urgent requirement. 


Mar 15, 2012 at 12:29 PM

i wonder what it has to do with 'Using GMap.NET in .NET4' ;} i guess nothing at all

Mar 15, 2012 at 3:33 PM

I wanted to knw if that can be done using in a windows forms application. Can Gmap be connected to the database to render xml resultset?

Mar 15, 2012 at 3:41 PM

you can render whatever you want

Mar 15, 2012 at 3:51 PM

Are there any examples that do such rendering?

Mar 15, 2012 at 3:58 PM

there are general demos, customize for yourself as you want

Mar 15, 2012 at 4:19 PM

There is hardly any documentation available.

Anyway, thanks for your help!

Mar 15, 2012 at 7:11 PM

nobody pay for documentation ;}