Referencing LocalArcGISDynamicMapServiceLayer from background thread

Discussion created by psiclopz on Sep 5, 2011
Latest reply on Jul 10, 2013 by MBranscomb-esristaff
I found an interesting thing today.  Not sure if it's a bug or by design.

I have a LocalArcGISDynamicMapServiceLayer that was instantiated on the main thread, and now I'm going to run a QueryTask in a background thread.  To create the QueryTask you need the url for the layer, but if you try to reference the .Url property you get an InvalidOperationException with message "The calling thread cannot access this object because a different thread owns it." error.  but if you reference .Service.Url it works just fine.

Either way, using Service.Url works so I'm not stuck or anything.  Just thought I'd mention that.