错误FileDataStore-system.aggregateexception发生一个或多个错误

时间:2019-10-18 11:49:51

标签: c# google-calendar-api visual-studio-2019

我创建了一个c#表单来测试Google日历API身份验证以创建事件。 当我运行“ GoogleWebAuthorizationBroker.AuthorizeAsync”时,出现错误。

***string [] Scopes = {CalendarService.Scope.CalendarEvents};
             string ApplicationName = "Google Calendar Test";
             UserCredential credential = null;
             using (var stream =
                 new FileStream ("API credentials.json", FileMode.Open, FileAccess.Read))
             {
                 string credPath = "token.json";
                 credential = GoogleWebAuthorizationBroker.AuthorizeAsync (
                     GoogleClientSecrets.Load (stream) .Secrets,
                     Scopes,
                     "User"
                     CancellationToken.None,
                     new FileDataStore (credPath, true)). Result;
             }***

System.AggregateException发生一个或多个错误 FileNotFoundException。

我试图更改目标文件夹,但没有任何变化。 谁能帮我吗?

0 个答案:

没有答案