簡體   English   中英

C# Google 日歷 API - 無效的截止日期日歷格式

[英]C# Google Calendar API - not valid Deadline calendar format

當我想執行該事件時,它沒有執行(這意味着該事件不在我的日歷中),並且我收到以下錯誤:

System.FormatException: The "Deadline calendar" google-api-dotnet-client/1.42.0.0 (gzip) value format is not valid.

知道如何解決這個問題嗎? 幾個月前它起作用了,我只是注意到它不再起作用了。

一些代碼示例:

public static CalendarService getCalendarService
{
   get
   {
      var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = clientId, ClientSecret = clientSecret },
      new[] { CalendarService.Scope.Calendar }, "user", CancellationToken.None).Result;
         return new CalendarService(new BaseClientService.Initializer { HttpClientInitializer = credential, ApplicationName = "Deadline calendar" });
    }
};

var ev = new Event
{
   ICalUID = project.RefId,
   Description = project.Description,
   Summary = string.Format("'{0} ({1})' project deadline", project.Name, project.RefId),
   Location = project.Location,
   Start = new EventDateTime { TimeZone = "MST", DateTime = project.EndDate.Value.Date },
   End = new EventDateTime { TimeZone = "MST", DateTime = project.EndDate.Value.Date.AddDays(1) },
   Attendees = attendees.Select(x => new EventAttendee() { Email = x.Email, Organizer = (x.Id == project.Responsible ? true : false) }).ToList()
};

var projectEvent = getCalendarService.Events.Insert(ev, "primary");
projectEvent.SendNotifications = true;
projectEvent.Execute();

好吧,問題是應用程序名稱的格式。 我使用了該字符串中不允許的字符,例如:“á, ő”。

無論如何,謝謝你的回答::)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM