Trying to Authenticate and access Google Calendar Service with C# Beta v1.6 SDK and something does not look right
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Auth;
using Google.Apis.Authentication;
using Google.Apis.Calendar.v3;
using System.Threading;
using Google.Apis;
using Google.Apis.Services;
var uc = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets() {
ClientId = string.Empty,
ClientSecret = string.Empty },
new[] { CalendarService.Scope.Calendar },
"user",
CancellationToken.None);
var service = new CalendarService(new BaseClientService.Initializer()
{
HttpClientInitializer = uc,
ApplicationName = "Google Calendar Test"
});
In particular this line: HttpClientInitializer = uc,
I'm following Task vb example: Tasks VB Sample
The error message that I get is this:
Error 1 Cannot implicitly convert type 'System.Threading.Tasks.Task' to 'Google.Apis.Http.IConfigurableHttpClientInitializer'. An explicit conversion exists (are you missing a cast?)