Being stupid is fun: Let's create long exception messages!

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A playful exploration of .NET internals through the lens of creating the longest possible exception message in C#. The post walks through why `new string('X', int.MaxValue)` throws an OverflowException (a single object can't exceed 2 GB, and chars are 2 bytes each), how to find the practical upper limit by accounting for object

4m read time From steven-giesel.com
Post cover image
1 Comment

Sort: