Register  |  Login
ThinkGeo - GPS Tracking and Mapping Solutions  |  Visit the Wiki  |  Find us on: Twitter Facebook Google+ LinkedIn

Discussion Forums

The online community for users of Map Suite GIS components

Silverlight 4009 error
Last Post 05-04-2012 01:05 PM by Gary. 5 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
CESARUser is Offline
Level 1
Level 1
Posts:19
Avatar

--
04-23-2012 03:02 PM

When using a ThingGeo Map control in a Silverlight Foatable window (http://floatablewindow.codeplex.com/) I get the following error after the Map control is initialized:

Error:  Unhandled error in silverlight application

Code: 4009

Category:  ManagedRuntimeError
Message:  Element is already the child of another element.

 

I'm using IE8, Silverlight 4, VS 2010, ThinkGeo Silverlight Edition.  I created a class that inherits from ThinkGeo.MapSuite.SilverlightEdition.Map.  I tried adding this control in a XAML file, creating a field in the container window, creating the instance in the window load event...  None of this fixed the error.

I have tested the Map control in XAML UserControl and it works fine.  There could be a problem including it in Silverlight Child or Foatable windows.  I need to include the Map in a FloatableWindow, also in my application there could be more than one FloatableWindow with a Map active at the same time...

Any suggestions?

 

GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
04-23-2012 05:34 PM
Hello CESAR,

Thanks for your post, do you have more detailed stack trace?

And I did some research with google, it's said the reason of 4009 something like "key is already in the collection", caused by adding the same object to a panel twice, could you please try only have one FloatableWindow?

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

CESARUser is Offline
Level 1
Level 1
Posts:19
Avatar

--
04-23-2012 07:15 PM

I'm doing my tests only with one FloatableWindow.

The stack trace is:

en System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
en System.Net.DownloadStringCompletedEventArgs.get_Result()
en ThinkGeo.MapSuite.SilverlightEdition.Map.x7d3e844ef1be85fd(Object xd9272088e65bd176, DownloadStringCompletedEventArgs xc2fd4c0ed406cdb7)
en System.Net.WebClient.OnDownloadStringCompleted(DownloadStringCompletedEventArgs e)
en System.Net.WebClient.DownloadStringOperationCompleted(Object arg)

The inner exception stack trace is:

en System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
en System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
en System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
en System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)

And the most inner exception is:

en System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
en System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.b__4(Object sendState)
en System.Net.Browser.AsyncHelper.<>c__DisplayClass4.b__1(Object sendState)

I have a more specific exception message:

"Exception during the operation.  The result is not valid.  Verify the InnerException to obtain more details."  And the inner exception says:  "Remote server returned an error: NotFound"

It is important to mention that the Map control is just placed in the window, I'm not connecting it to any data source, it is empty.


Thanks,
César

GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
04-25-2012 10:16 AM
Hello CESAR,

I did more investiation, but I think I need a demo to reproduce it, can you let give me a brief description and simple demo for recreation? If it’s proved as bug, I can create an Gemini issue and let you know the result as soon as we fix it.

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

CESARUser is Offline
Level 1
Level 1
Posts:19
Avatar

--
05-03-2012 07:22 PM
Hello,
I isolated usages of the MapSuite Map control and fortunately the problem went away. It seems that there are some other controls in the same window that are causing the problem, however, I don't understand how was MapSuite.SilverlightEdition.Map involved in the
exception stack trace... I'll try to fix the error focusing on the other components.

Thanks,
César
GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
05-04-2012 01:05 PM
Hello CESAR,

Ok, thanks for your help, if you find any way to recreate this problem, feel free to let us know.

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

You are not authorized to post a reply.

Active Forums 4.2