Aspose.Email  for .NET

How to Merge ICS Files in C#

Intuitive and high-performance .NET API to merge ICS files.

Merging ICS (iCalendar) files is a functional solution for storage files handling. Its implementation in an email app streamlines the processes of coordinating schedules, managing events, or synchronizing appointments task for individuals and organizations dealing with calendar data from various sources. The consolidation of ICS files into a unified format enhances the entire calendar management process.

Aspose.Email for .NET plays a pivotal role in simplifying this process by offering a robust API designed for creating, manipulating, and merging ICS files. Developers can leverage its capabilities to efficiently merge multiple ICS files, ensuring that valuable calendar data is consolidated, organized, and readily accessible. The user-friendly API and straightforward code provided by Aspose.Email make the task smooth and intuitive, allowing developers to implement this feature seamlessly into their .NET applications.

The .NET API is easy to install and utilize. Start optimizing your data management with Aspose.Email for .NET by performing one of the following actions:

  • Open NuGet package manager, search for Aspose.Email and install it on your device.

  • Use the following command from the Package Manager Console:

PM> Install-Package Aspose.Email

Steps for Merging ICS Files in C#

A basic document merging and concatenating with Aspose.Email for .NET APIs can be done with just few lines of code.

  1. Create an array of source ICS files.
  2. Initialize a new CalendarWriter object to write to the target ICS file, using AppointmentIcsSaveOptions .
  3. Read each source ICS file using CalendarReader , loading multiple appointments using LoadAsMultiple .
  4. Write each appointment from the source ICS files to the target ICS file using CalendarWriter .

System Requirements

Our APIs are supported on all major platforms and Operating Systems. Before executing the code below, please make sure that you have the following prerequisites on your system.

  • Microsoft Windows or a compatible OS with .NET Framework, .NET Core, Windows Azure, Mono or Xamarin Platforms
  • Development environment like Microsoft Visual Studio
  • Aspose.Email for .NET DLL referenced in your project - Install from NuGet using the Download button above

Merge ICS Files - C#

string[] sourceIcsFiles = { "source1.ics", "source2.ics", "source3.ics", ... "sourceN.ics" };

using (var targetIcs = new CalendarWriter("target.ics", new AppointmentIcsSaveOptions()))
    foreach (var sourceIcsFile in sourceIcsFiles)
        var sourceIcs = new CalendarReader(sourceIcsFile);
        var appointments = sourceIcs.LoadAsMultiple();

        foreach (var appointment in appointments)

Advanced Functionality in your App

Try the code sample below to estimate its performance and efficiency. The code is a component of a versatile API offering the following features:

  • Simplified handling and manipulation of email messages.
  • Efficient management of email attachments and calendar items.
  • Streamlined integration with popular email formats and services.
  • Comprehensive support for email security and encryption.
  • User-friendly API for seamless implementation into .NET applications.

Here are the benefits you will get with the API’s ability to merge ICS files:

  1. Consolidated Calendar Management: a simple process of consolidating calendar data from multiple ICS files into a unified format, enabling streamlined calendar management.

  2. Simplified Scheduling: an easy synchronization and management of schedules, events, and appointments across different calendars.

  3. Enhanced Organizational Efficiency: increased organizational efficiency by centralizing and organizing calendar data.

  4. Data Accuracy: the accuracy and integrity of merged ICS files with minimum risk of errors or inconsistencies in calendar data.

  5. Seamless Integration: integrate seamlessly calendar data from various sources, creating a cohesive and comprehensive calendar solution.

  6. User-Friendly Implementation: an intuitive and user-friendly API, easy for developers to implement the merging of ICS files into their .NET applications efficiently.

  • .NET API: A Brief Look

    Aspose.Email for .NET is a comprehensive library designed for developers to efficiently create, manipulate, and manage email messages and related data within their .NET applications. Our powerful API offers a wide range of features, including the ability to work with various email formats (such as PST, MSG, EML, and MHT), handle contacts, calendars, and attachments, and perform tasks like sending, receiving, and parsing emails. With its user-friendly design and extensive functionality, Aspose.Email for .NET provides a seamless solution for integrating email-related functions into .NET applications.

    Aspose.Email provides free access to its resources:

    • a comprehensible documentation with thorough instructions on all supported features
    • support forum providing professional answers to all possible questions
    • the blog with a collection of posts on urgent issues
    • advanced features of the library

    The API is standalone and does not require Microsoft Outlook or any other software installation.

    ICS What is ICS File Format

    The Internet Calendaring and Scheduling Core Object Specification (iCalendar) is an internet standard(RFC 2445) for exchanging and deploying the calendaring events and scheduling. The iCalendar format is interoperable, thereby ensuring the exchange of calendar information among the users having different email applications. iCalendar formats the input data as a Multipurpose Internet Mail Extensions (MIME) and facilitates the object exchanged via different transport protocols. These transport protocols can be SMTP, HTTP, point-to-point asynchronous communication, and physical media based-network transport. iCalendar allows users to share events, date/time dependent tasks, and free/busy information via emails to other users who can respond back. iCalendar files store using suffixes ".ics" ".iCalendar" or ".ifb" with a MIME type of "text/calendar".

    Read More