首页 \ 问答 \ 远程过程调用失败(The remote procedure call failed)

远程过程调用失败(The remote procedure call failed)

这是我的第一篇文章,所以请对我很轻松:)

我正在为Facebook SDK一个教程 ,我正在尝试从Windows Phone XAML应用程序登录到facebook服务。 当我按照教程的步骤操作时,它工作正常,并点击登录按钮登录,但当我尝试自动执行此操作时,我收到错误。

该代码使用WebAuthenticationBroker,调用WebAuthenticationBroker.AuthenticateAndContinue(LoginUrl);

当我尝试将该代码放在Loaded事件中时

private void Page_Loaded(object sender, RoutedEventArgs e)
{
    if (this.fbHelper.AccessToken == null)
    {
         WebAuthenticationBroker.AuthenticateAndContinue(LoginUrl); //throws error
    }
    else
    {
        GetUserInfo();
    }
}

我收到以下错误:

远程过程调用失败。 (HRESULT异常:0x800706BE)

我认为问题是页面尚未准备好执行逻辑,但我真的不知道我应该在哪里放置代码?


This is my first post, so please be easy on me :)

I am doing a tutorial for Facebook SDK, and I am trying to login to the facebook service from a Windows Phone XAML application. It works fine when I follow the steps of the tutorial, and hit the login button to log in, but when I am trying to automate this, I get an error.

The code uses WebAuthenticationBroker, calling WebAuthenticationBroker.AuthenticateAndContinue(LoginUrl);

When I try to put that code inside Loaded event

private void Page_Loaded(object sender, RoutedEventArgs e)
{
    if (this.fbHelper.AccessToken == null)
    {
         WebAuthenticationBroker.AuthenticateAndContinue(LoginUrl); //throws error
    }
    else
    {
        GetUserInfo();
    }
}

I get the following error:

The remote procedure call failed. (Exception from HRESULT: 0x800706BE)

I think the problem is that the page is not ready yet to perform the logic, but I don't really know where should I put the code?


原文:https://stackoverflow.com/questions/29321086
更新时间:2022-09-03 18:09

最满意答案

这是一个错字。 它应该是alert(layer.getLatLng().toString());


Andy thanks for solution but it is not typo.
If you are working with Markers, you have to use getLatLng() function because Marker has only one LatLng.
If you are working with more than 1 point like polygon, polyline, you have to use getLatLngs() function. I was working with Marker and i was trying to use getLatLngs() with Marker. That was the problem

相关问答

更多
  • 只需更改此行,即可将rs变量初始化为字符串而不是Jquery对象。 rs = $("#circle"+r); var s = rs; //add inverted comma Just change this line, you are initializing the rs variable as a string instead of a Jquery object. rs = $("#circle"+r); var s = rs; //add inverted comma
  • listview函数可能是jQuery的插件。 该插件文件是否已及时添加到页面? 该错误可能意味着缺少插件。 The listview function is presumably a plugin for jQuery. Has that plugin file been added to page in time? That error can mean a missing plugin.
  • 看起来你忘了添加tagsinput js脚本..(和obivously jquery.js) 这里在标签中添加它