1
Answer

Error - cannot convert from Google.Apis.Util.Store.FileDataStore

Ramco Ramco

Ramco Ramco

2y
457
1

Hi

  I am getting below error - Severity    Code    Description    Project    File    Line    Suppression State
Error    CS1503    Argument 4: cannot convert from 'Google.Apis.Util.Store.FileDataStore' to 'System.Threading.CancellationToken'   

UserCredential credential;
using (var stream = new FileStream("client_secrets.json", FileMode.Open, FileAccess.Read))
{
    credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
        GoogleClientSecrets.Load(stream).Secrets,
        new[] { YouTubeService.Scope.YoutubeReadonly },
        "user",
        //CancellationToken.None,
        new FileDataStore(this.GetType().ToString())
    );
}

Thanks

Answers (1)