Skip to content

Migrating Guides

axunonb edited this page Jul 20, 2025 · 7 revisions

๐Ÿ“ฆ iCal.NET v5.x Migration Guide

This guide outlines the breaking changes, removals, and new patterns introduced in iCal.NET v5.x, helping you update your codebase from v4.3.1.

In general, users' feedback has been overwhelmingly positive, and the migration is expected to be straightforward for most users implementing standard iCalendar functionality.

For a detailed list of changes, please refer to the API Changes v4 to v5.


What's New in iCal.NET v5.x

๐Ÿš€ Improved Performance and Stability

The v5.x release includes significant performance improvements and stability enhancements, particularly in recurrence evaluation and timezone handling. Below are benchmark comparisons between v4.3.1 and v5.0.0 GA:

v4.3.1

Method Mean Error StdDev Gen0 Gen1 Allocated
SerializeCalendar 6.574 us 0.0761 us 0.0712 us 1.3733 0.0305 21.24 KB
DeserializeCalendar 16.047 us 0.2156 us 0.2016 us 3.7231 0.2441 57.03 KB
Get1000Occurrences 4,011.561 us 56.7021 us 53.0392 us 679.6875 515.6250 10426.99 KB

v5.0.0

Method Mean Error StdDev Gen0 Gen1 Allocated
SerializeCalendar 6.416 us 0.0614 us 0.0544 us 1.5640 0.0381 20.03 KB
DeserializeCalendar 14.119 us 0.1875 us 0.1754 us 3.1281 0.1526 47.95 KB
Get1000Occurrences 844.840 us 6.9896 us 6.1961 us 144.5313 102.5391 2218.26 KB

๐Ÿž Issues from v4.x Addressed

Around 50 issues have been addressed in the v5.0.0 release. These include many timezone handling improvements and recurrence evaluation fixes.

In case you have implemented workarounds for any of these issues, please review the GitHub issue tracker for details on how they have been resolved.

๐Ÿ”ฎ Future

We encourage all users to migrate to iCal.NET v5.x to benefit from improved performance, stability, and null-safety.

The project is actively maintained, and we are working on further improvements that may introduce additional breaking changes in future major releases.

Your feedback is valuable โ€” please let us know about your migration experience or any issues by opening an issue or discussion on the GitHub repository.


Migration

โ“ Nullable Reference Types (NRT) Support

iCal.NET v5.x now enables Nullable Reference Types (NRT) throughout the library. This means:

  • Reference type nullability is now explicitly annotated in all public APIs.
  • The compiler will provide warnings for possible null reference issues, helping you write safer and more robust code.
  • Consumers targeting .NET Core 3.0+, .NET Standard 2.1+, or .NET 5+ will benefit from improved static analysis and null-safety.

Review your code for new nullable warnings after upgrading, and update your null-handling logic as needed.

๐Ÿ”ง Major Breaking Changes

1. Removal of IDateTime and PeriodList

  • Replaced by: CalDateTime, ExceptionDates, and RecurrenceDates
  • Impact: All APIs using IDateTime or PeriodList must be updated to use the new types.

Before:

IDateTime start = ...;
calendar.GetOccurrences(start, end);

After:

CalDateTime start = ...;
CalDateTime toDate = ...;
calendar.GetOccurrences(start, new EvaluationOptions());
calendar.GetOccurrences(start).TakeWhileBefore