c# - .NET 5 Core API 中的 Google Calendar v3 应用程序可能出了什么问题,它会在一年以上的正常运行时间后突然停止工作?
问题描述
我首先通过在执行请求后停止应用程序的任何结果处理来验证失败是由于执行以下 ListRequest 直接导致的:
EventsResource.ListRequest(builder.GetCalendarService(), "user@domain.com") { Key = "API_KEY", TimeMin = DateTime.Now.AddDays(-3), TimeMax = DateTime.Now.AddDays(21), ShowDeleted = false, SingleEvents = true, OrderBy = EventsResource.ListRequest.OrderByEnum.StartTime };
所有其他请求也已停止工作。构建 GoogleCredential 和 CalendarService 执行没有错误,除非它在实际请求执行之前不执行:
string[] Scopes = {
CalendarService.Scope.Calendar,
CalendarService.Scope.CalendarEvents,
CalendarService.Scope.CalendarEventsReadonly};
FileStream stream = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "auth\\apiinfofile.json", FileMode.Open, FileAccess.Read);
GoogleCredential credential;
credential = GoogleCredential.FromStream(stream).CreateScoped(Scopes).CreateWithUser("user@appname.iam.gserviceaccount.com");
CalendarService service = new CalendarService(new BaseClientService.Initializer { HttpClientInitializer = credential, ApplicationName = "appname" });
API 最近有没有我不知道的变化?
我正在使用 1.49 版的 Google API 包并尝试更新到 1.55 版,因为据我所知,这是唯一改变的地方,但没有运气。
是否有任何内容将过期或需要更新的内容?
解决方案
推荐阅读
- c# - 在单个 LDAP 查询中查找 ouGroup 及其所有成员,其中 Common Name 包含给定短语
- .net-core - 无法将我的解决方案从 v2.1.0 升级到 v2.1.3
- c# - XML,编码,C# SOAP
- sql - 使用 datediff 和之间的运行时错误
- go - go1.10 之前的天花板功能
- kubernetes - 如何区分同名的 Prometheus 指标和 Kubernetes 中动态发现的微服务
- php - 如何在执行操作的表中创建下拉菜单,即根据该行中的条目重定向到页面(HTML,PHP)
- django - Django 自定义模板标签
- javascript - 正确的错误处理 - 在 javascript/Ionic 中
- regex - 使用 RegEx 表达式删除 Windows 目录路径