NetEscapades.EnumGenerators, a .NET source generator that produces fast enum extension methods, has been restructured into three packages ahead of a stable 1.0.0 release. The change was triggered by a breaking issue: users who set PrivateAssets=all and ExcludeAssets=runtime on the package reference (a common pattern for library authors) started getting CS0012 errors after new EnumParseOptions and SerializationOptions types were added to the attributes DLL. The solution splits the package into a metapackage (NetEscapades.EnumGenerators), a generator-only package (NetEscapades.EnumGenerators.Generators), and a runtime dependencies package (NetEscapades.EnumGenerators.RuntimeDependencies). If the runtime dependencies package is absent, the generator emits nested type versions of the options types instead, avoiding transitive dependency requirements at the cost of more verbose API usage. The post also outlines open questions around analyzer defaults, nested type visibility, and API overload ambiguity that need resolving before the 1.0.0 release.
Table of contents
Why should you use an enum source generator?Adding new features by adding to the marker attribute dllWhen new features break users…The solution: more packagesOpen questions before a stable releaseSummarySort: