When I want to execute the event, it doesn't execute (which means that the event is not in my calendar), and I get the following error:
System.FormatException: The "Deadline calendar" google-api-dotnet-client/1.42.0.0 (gzip) value format is not valid.
Any idea how to fix this? It worked some month ago and I just noticed that it doesn't work anymore.
Some code example:
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();