无法将类型'Xamarin.Auth.OAuth2Authenticator'隐式转换为'Google.Apis.Http.IConfigurableHttpClientInitializer'

时间:2015-02-25 20:47:54

标签: android xamarin.ios xamarin oauth-2.0

我正在尝试使用带有流动代码和身份验证的Google云端硬盘服务

var auth = new OAuth2Authenticator (
clientId: xxxxxxxx
scope: "https://www.googleapis.com/auth/drive",
authorizeUrl: new Uri ("https://accounts.google.com/o/oauth2/auth"),
redirectUrl: new Uri ("myredirect:oob"));

并尝试按

初始化Google云端硬盘服务
var service = new DriveService(new BaseClientService.Initializer()
{
HttpClientInitializer = auth,
ApplicationName = "Google Drive API Sample",
});

但上面的代码显示错误 错误CS0266:无法隐式转换类型' Xamarin.Auth.OAuth2Authenticator'到Google.Apis.Http.IConfigurableHttpClientInitializer'。存在显式转换(您是否缺少演员?)(CS0266)

0 个答案:

没有答案