I have a tool that lets users swap a base map. If I start the map loaded with a tiled map layer, then switch to the Bing base map layer I get an error message when adding the Bing base map layer to my Layers collection.The error message is:Could not find endpoint element with name 'BasicHttpBinding_IImageryService' and contract 'ImageryService.IImageryService' in the ServiceModel client configuration section. It works fine if I load Bing right off the bat. It works fine switching between different Bing map types, and works fine switching from Bing to my custom tiled service. I only get this exception when switching from a custom tiled service to Bing.This is using the SL 3.0 RC version. I have not tried it in any previous versions. private void SwapTheBaseMap(bool bResetExtent, ESRI.ArcGIS.Client.Bing.TileLayer.LayerType layertypeEnum, string token) { ViewableMapServices.Clear(); if (bResetExtent) ZoomToGeometry = null; //Tell the map to clear its extent using a custom extension on the Map class //Add Base Map if (token != null) { ESRI.ArcGIS.Client.Bing.TileLayer tileLayer = new ESRI.ArcGIS.Client.Bing.TileLayer() { ID = "BingLayer", LayerStyle = layertypeEnum, ServerType = ESRI.ArcGIS.Client.Bing.ServerType.Production, Token = token }; tileLayer.InitializationFailed += (o, e) => { //don't throw an exception, we log it instead }; ViewableMapServices.Add(tileLayer); //this is where it throws the error } //Call a function that re-adds non base map layers AddOperationalLayers(); }
Has anyone seen this exception before? I can provide the stack trace if that is helpful. This is the last non-Microsoft call in the stack trace for the error: ESRI.ArcGIS.Client.Bing!ESRI.ArcGIS.Client.Bing.ImageryService.ImageryServiceClient.ImageryServiceClient(string endpointConfigurationName)Thanks