【问题标题】:Windows 10 UWP App: GoogleWebAuthorizationBroker; Failed to launch browser exceptionWindows 10 UWP 应用:GoogleWebAuthorizationBroker;无法启动浏览器异常
【发布时间】:2017-06-17 04:25:14
【问题描述】:

希望有人以前遇到过这个问题;

我正在 Windows 10 上构建一个通用 Windows 平台 (UWP) 应用程序,该应用程序使用来自 Google Web Master Tools API 的数据,当我尝试使用 Google Web Authorization Broker 进行授权时,我遇到了以下异常:

InnerException = {System.NotSupportedException: 无法使用“https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&response_type=code&client_id=437110116900-jfsnbikhkj8l4aetubtkn52ggki45nm0.apps.googleusercontent.com&redirect_uri=http:%2F%2F127....”启动浏览器

代码sn-p:

string[] scopes = new string[] {
                WebmastersService.Scope.Webmasters
            };

using (var stream = new FileStream("client_secret.json",
                                   FileMode.Open, FileAccess.Read))
                {
                    UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                    GoogleClientSecrets.Load(stream).Secrets,
                    scopes,
                    userName,
                    CancellationToken.None,
                    new FileDataStore(".", true)).Result;
                }

提前致谢:)

干杯, 保罗

【问题讨论】:

  • 我在控件的发行说明中发现了这个小宝石:- UWP(将构建,但已知在运行时不起作用)似乎我在用这种方法浪费我的时间。

标签: google-api google-oauth google-api-dotnet-client google-api-webmasters


【解决方案1】:

Google APIs .net client library 目前不支持 UWP。见Investigate UWP support #983

问题是启动浏览器来验证库无法在 UWP 应用上执行此操作。

【讨论】:

  • 今天还是这样吗?
  • 没有变化它仍然不受支持
  • 我正在使用带有 .net 标准 2.0 的 xamarin 表单,您知道是否可以在不进入 UWP 级别的情况下在 .net 标准 2.0 项目中使用它?
  • xamarin 是不应该的,据我所知,我们没有计划在不久的将来提供支持。计划支持 UWP,但不知道何时
猜你喜欢
  • 2011-03-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-06-12
  • 2020-10-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多