System.IO.FileNotFoundException

Topics: Help
Apr 4, 2011 at 3:12 PM

Hi Radioman!

I got a strange problem: I use different forms in my Windows Forms project, each one has a GMapControl on it. I start my program with a MainForm that has NO GMapControls on it, the other forms are called from this main form and shown using form.ShowDialog()

Now when I FIRST open a form (does not matter which one) my debug Output Window shows a System.IO.FileNotFoundException for GMap.NET.Core.XmlSerializers , the details are here (In German, but it should be clear):

Die Datei oder Assembly "GMap.NET.Core.XmlSerializers, Version=1.5.3.3, Culture=neutral, PublicKeyToken=b85b9027b614afef" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.

When I close my form again, i have to wait for 5-to7 seconds before my main form reacts again.

But the strange thing is, this happens only ONCE! After the first error, I can open all forms without the error, and when I close them again, the MainForm reacts instantly.

Please help, I don't know how to get rid of this error!

Thanks a lot!

Xandolph

Coordinator
Apr 4, 2011 at 4:47 PM

o.O

Apr 11, 2011 at 8:18 AM
Edited Apr 11, 2011 at 8:19 AM

Hi Radioman!

I think I found what causes the problem:

It's the Dispose method of the GMapControl.

Please take a look at this code in my form Closed Event:

 

//Test:
DateTime start = DateTime.Now;
mapControl.Dispose();
mapControl = null;
DateTime end = DateTime.Now;
TimeSpan diff = end - start;
System.Diagnostics.Debug.WriteLine("Time to Dispose MapControl: " + diff);

 

When I FIRST open and close the form, this results in the following output:

Time to Dispose MapControl: 00:00:06.1620000
The thread 'GMap.NET CacheEngine' (0x1190) has exited with code 0 (0x0).

After that I get this output, and don't have to wait at all:

The thread 'GMap.NET CacheEngine' (0x5d4) has exited with code 0 (0x0).
Time to Dispose MapControl: 00:00:00

Do you have any idea, why the disposal takes over 6 seconds, the first time?

Thanks a lot!

 

Edit:

I don't think the System.IO.FileNotFoundException I mentioned in my first post, has anything to do with this problem.

Coordinator
Apr 11, 2011 at 8:33 AM

on app start/end control sends ping to codeplex, buf if you create/destroy controls, this happens only on first one

Apr 11, 2011 at 1:54 PM

Is there a way, I can speedt this up or bypass the ping?

Coordinator
Apr 11, 2011 at 2:24 PM

well you can disable it

Apr 11, 2011 at 2:25 PM

Where would I disable it?

Coordinator
Apr 11, 2011 at 2:41 PM

set in Core.cs

internal static volatile bool AnalyticsStartDone = true;
internal static volatile bool AnalyticsStopDone = true;