locked
Bing Maps - WebException was unhandled RRS feed

  • Question

  • I am trying to implement bing maps in my project. I have one Main page and Map page. 

    My Map Page Xaml is:

     <Grid x:Name="MapPageUIContainer" Grid.Row="1" Margin="2,0,2,0">
                <my:Map Height="682" HorizontalAlignment="Left" Margin="0,86,0,0" Name="map1" VerticalAlignment="Top" Width="476"/>          
            </Grid>

    Now i just navigate from the main page to Map page. When map is loaded I get exception that is:

    System.Net.WebException was unhandled
      Message=The remote server returned an error: NotFound.
      StackTrace:
           at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
           at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
           at SharpGIS.GZipHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
           at Microsoft.Phone.Controls.Maps.Map.LogResponse(IAsyncResult result)
           at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClassa.<InvokeGetResponseCallback>b__8(Object state2)
           at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadPool.WorkItem.doWork(Object o)
           at System.Threading.Timer.ring()
      InnerException: System.Net.WebException
           Message=The remote server returned an error: NotFound.
           StackTrace:
                at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
                at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClass2.<EndGetResponse>b__1(Object sendState)
                at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__0(Object sendState)
                at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
                at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
                at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
                at System.Delegate.DynamicInvokeOne(Object[] args)
                at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
                at System.Delegate.DynamicInvoke(Object[] args)
                at System.Windows.Threading.Dispatcher.<>c__DisplayClass4.<FastInvoke>b__3()
                at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
                at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
                at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
                at System.Delegate.DynamicInvokeOne(Object[] args)
                at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
                at System.Delegate.DynamicInvoke(Object[] args)
                at System.Windows.Threading.DispatcherOperation.Invoke()
                at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)
                at System.Windows.Threading.Dispatcher.OnInvoke(Object context)
                at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args)
                at System.Windows.Hosting.DelegateWrapper.InternalInvoke(Object[] args)
                at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)

    When i try with new sample it is working fine. But when i implement in my original project i am getting this error. 

    Please tell me why this error is happening and what is have to do to resolve this problem? 

    Thanks in advance.


    vijaydhas

    Wednesday, August 27, 2014 12:55 PM

Answers

  • I did not provide key. That is the problem. Now i provided the key for Bing Map.

    <Grid x:Name="MapPageUIContainer" Grid.Row="1" Margin="2,0,2,0">         
                <my:Map Margin="0,80,0,0" Name="map1" CredentialsProvider="My Key"/> 
            </Grid>
    
    Now it is working fine.


    vijaydhas

    Thursday, August 28, 2014 7:29 AM

All replies

  • I did not provide key. That is the problem. Now i provided the key for Bing Map.

    <Grid x:Name="MapPageUIContainer" Grid.Row="1" Margin="2,0,2,0">         
                <my:Map Margin="0,80,0,0" Name="map1" CredentialsProvider="My Key"/> 
            </Grid>
    
    Now it is working fine.


    vijaydhas

    Thursday, August 28, 2014 7:29 AM
  • Hi Vijaydhas,

    I am very glad that your have solved your problem.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, August 28, 2014 9:26 AM