我正在使用EWS向我公司的帐户发送约会,这些帐户是在c#.net MVC 3上开发的。
代码
var service = new ExchangeService(ExchangeVersion.Exchange2013,TimeZoneInfo.Local);
service.Credentials = new WebCredentials("myuser", "mypassowrd", "mycompany");
service.TraceEnabled = true;
service.TraceFlags = TraceFlags.All;
service.Url = new Uri(uriString: "myexchangeserver" );
TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("Pacific SA Standard Time");
Appointment appointment = new Appointment(service);
appointment.Subject = "TestMeeting";
appointment.Body = "The purpose of this meeting is to discuss status.";
appointment.Start = new DateTime(2017, 12, 12, 9, 0, 0);
appointment.End = appointment.Start.AddHours(2);
appointment.Location = "Conf Room";
appointment.RequiredAttendees.Add("myemail@mycompany.cl");
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);
我的问题如下,当我执行代码直到最后一行时,下一个异常返回:
{"The specified time zone isn't valid."}
我无法找到任何解决方案,如果您需要更多信息,请在评论中注明,非常感谢并抱歉我的英语不好:c