.NET 8, Top 10 Features You Can’t Miss in 2023

Release Candidate Features

Alex Maher


Every time I dive into a new .NET release, I’m like a kid in a candy store, and .NET 8 is no exception.

It feels like Microsoft has been reading my developer wishlist! Serialization upgrades to the beefed-up networking features, .NET 8 is shaping up nicely. So, why am I so excited about this release? Let’s jump in and explore together.

1. Time Abstraction in .NET 8

.NET 8 introduces the TimeProvider class and ITimer interface to add time abstraction functionality. This allows developers to mock time in test scenarios. Additionally, you can use the time abstraction to mock Task operations that rely on time progression using Task.Delay and Task.WaitAsync.

Code Examples:

// Get system time.
DateTimeOffset utcNow = TimeProvider.System.GetUtcNow();
DateTimeOffset localNow = TimeProvider.System.GetLocalNow();
// Create a time provider that works with a different time zone 
// than the local time zone.
private class ZonedTimeProvider : TimeProvider
private TimeZoneInfo _zoneInfo;

public ZonedTimeProvider(TimeZoneInfo zoneInfo) : base()
_zoneInfo = zoneInfo ?? TimeZoneInfo.Local;

public override TimeZoneInfo LocalTimeZone => _zoneInfo;

public static TimeProvider FromLocalTimeZone(TimeZoneInfo zoneInfo) =>
new ZonedTimeProvider(zoneInfo);

Imagine building a feature that sends reminders to users based on their local time. With the new time abstraction, you can mock different time zones and test how your reminders work around the globe without waiting for actual time to pass.

2. UTF8 Improvements

.NET 8 introduces the IUtf8SpanFormattable interface, which allows for efficient formatting directly to UTF8. This new interface is closely related to ISpanFormattable, but targets UTF8 and Span<byte> instead of UTF16 and Span<char>.



Alex Maher

.NET C# dev with 10+ yrs exp, self-taught & passionate web developer. Sharing tips & experiences in C# and web dev.