Free Support Forum - aspose.com

The given key was not present in the dictionary- erroe message while saving the ics file

Hi,

I am trying to save the appointment.But i am getting error message "The given key was not present in the dictionary."

Aspose.Email.Mail.Appointment app = new Aspose.Email.Mail.Appointment

(

location,

evt.Start_Date,

evt.End_Date,

ConfigurationManager.AppSettings["FROM"],

ConfigurationManager.AppSettings["TO"]

);

app.Summary = evt.EvtTitle;

app.Description = evt.EvtDescription;

//var icsInMessage = string.Format("test.ics", Server.MapPath("~/"));

app.Save(@"c:\\test.ics", AppointmentSaveFormat.Ics);//Here only i am getting error message.

Thanks,

Jacintha

Hi Jacintha,


I am afraid to inform that I have tried this constructor in Appointment class and found the following code working. Issue seems to be in configuration or some other argument to the constructor. You may please try it and let us know your feedback.
Aspose.Email.Mail.Appointment app = new Aspose.Email.Mail.Appointment
(
"location",
new DateTime(2012, 11, 1, 9, 0, 0),
new DateTime(2012, 11, 2, 17, 0, 0),
"newcustomeronnet@gmail.com",
"newcustomeronnet@gmail.com"
);
app.Summary = "Summary";
app.Description = "Description";
app.Save("test.ics", AppointmentSaveFormat.Ics);