I just used DDay.iCal , which works great for C #. You can see the documentation here on how to read / parse the .ics file, and this is what I used to create a new file, it checks if Outlook and the iOS email application are working:
public static string GetCalendarAsString(string subject, DateTime start, DateTime end, string location, string timeZoneName) { var calendar = new iCalendar(); var timeZone = TimeZoneInfo.FindSystemTimeZoneById(timeZoneName); calendar.AddTimeZone(iCalTimeZone.FromSystemTimeZone(timeZone)); var evt = new Event { Start = new iCalDateTime(start), End = new iCalDateTime(end), Location = location, Summary = subject, IsAllDay = false }; calendar.Events.Add(evt); var serializer = new iCalendarSerializer(); return serializer.SerializeToString(calendar); }
you can use several other properties, although I only need these
Luiso source share