C# Windows 10 UAP应用程序上的Google登录错误

C# Windows 10 UAP应用程序上的Google登录错误,c#,visual-studio,xaml,windows-10,google-login,C#,Visual Studio,Xaml,Windows 10,Google Login,我在Windows 10上遇到了这个奇怪的问题,我使用的代码与我在Windows 8.1应用程序上使用的代码相同,但我无法通过Google登录验证 我做错了什么 public async Task<string> LogIntoGoogle() { try { credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(

我在Windows 10上遇到了这个奇怪的问题,我使用的代码与我在Windows 8.1应用程序上使用的代码相同,但我无法通过Google登录验证

我做错了什么

public async Task<string> LogIntoGoogle()
        {
            try
            {
               credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                    new Uri("ms-appx:///Assets/client_secrets.json"),
                    new[] { "https://www.googleapis.com/auth/plus.profile.emails.read" },
                    "user",
                    CancellationToken.None);

                return credential.Token.AccessToken;

            }
            catch (Exception exe)
            {

                var data = exe;
            }
            return "";
        }
public异步任务LogIntoGoogle()
{
尝试
{
凭证=等待GoogleWebAuthorizationBroker.AuthorizationAsync(
新Uri(“ms-appx:///Assets/client_secrets.json"),
新[]{”https://www.googleapis.com/auth/plus.profile.emails.read" },
“用户”,
取消令牌(无);
返回credential.Token.AccessToken;
}
捕获(异常exe)
{
var data=exe;
}
返回“”;
}
编辑:看起来我只有2个谷歌参考:


Edit2:是的,我丢失了Google.Api.Core引用。

你确定你有所有正确的引用吗?谷歌登录?你应该有3个

更新:看起来您缺少Google.Api.Core引用