Dev Tools · 1h ago
C# library FtrIO uses IL weaving for compile-time feature flags
FtrIO introduces a [Toggle] attribute that turns any C# method into a feature flag without if statements or magic strings. The method name becomes the toggle key, and IL weaving removes dead code at compile time when the flag is off. A Roslyn analyzer catches mismatches between flags and configuration at build time.
Meridian48 take
The approach elegantly solves the ceremony and safety problems of runtime feature flags, but its reliance on IL weaving may raise concerns for teams wary of build-time code transformation.
Read the full reporting
Compile-time feature flags in C# using IL weaving and a Roslyn analyzer →
DEV Community
csharpfeature-flags