Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 用于.Net的Google日历API:创建日历事件时未发送电子邮件通知_C#_Google Api_Google Calendar Api - Fatal编程技术网

C# 用于.Net的Google日历API:创建日历事件时未发送电子邮件通知

C# 用于.Net的Google日历API:创建日历事件时未发送电子邮件通知,c#,google-api,google-calendar-api,C#,Google Api,Google Calendar Api,我正在开发一个windows服务,它使用Google Calendar API v3创建和删除日历事件。我的代码正在运行,但在创建新事件时,电子邮件通知永远不会发送给被邀请者。这些活动只会出现在他们的日历上 以下是一段代码片段: EventsResource.InsertRequest insertRequest = new EventsResource.InsertRequest(calendarService, eventRequest, calendarID); insertRequest

我正在开发一个windows服务,它使用Google Calendar API v3创建和删除日历事件。我的代码正在运行,但在创建新事件时,电子邮件通知永远不会发送给被邀请者。这些活动只会出现在他们的日历上

以下是一段代码片段:

EventsResource.InsertRequest insertRequest = new EventsResource.InsertRequest(calendarService, eventRequest, calendarID);
insertRequest.SendNotifications = true;
var response = insertRequest.Execute();
我已经使用Google Calendar API explorer测试了使用相同的身份验证凭据创建相同的事件:

当我使用该表单创建事件时,电子邮件通知会正确发送,因此我认为这不是谷歌方面的配置或身份验证问题。我开始认为这是Google API for.Net中的一个bug(我使用的是最新版本-1.8.1.95)。我正在将SendNotification属性设置为true,但可能它没有添加到发出的实际请求中

还有其他人有这个问题吗?

试试这个:

Event EventNew = new Event();
/*Complete the event*/
EventNew.Summary = "test";
EventNew.Description = ....
EventNew. ......

 EventsResource.InsertRequest request = CalendarioGoogle.Events.Insert(EventNew,calendarID);

request.SendNotifications = true;


/*In this case result is a Event*/
result = request.Execute();

您能打印http请求并检查它是否有正确的参数吗?我实际上试图找到一种方法来实现这一点,但没有找到答案。HTTP请求是在GoogleAPI程序集中的引擎盖下构造的。我只能将其调试到调用InsertRequest.Execute()的位置,并且该位置的请求将SendNotifications参数设置为true。我尝试用WireShark监视HTTP请求,但数据是加密的。也许有另一种方式可以查看我没有想到的实际HTTP请求?您正在创建的事件是否可能是在过去?不,我尝试了几个不同的日期来创建事件,并且都是在未来-本周晚些时候的不同日子。我将完全相同的数据插入了Calendar API explorer,从那里提交时,事件通知会正确发送。您能否检查它在以前的版本中是否工作正常,例如:Google.API.Calendar.v3 Client Library 1.8.1.840()