Skip to content

SourceGen Utils

SourceGen Utils is a collection of utilities for C# source generators that get emitted directly into your source generator assembly, thus zero dependencies!

  • Zero dependencies - Your assembly can be distributed as a single dll file without any additional dependencies
  • Only use what you need - The generator emits lightweight shells and implements only the methods you use; the trimmer removes the rest.
  • High performance utilities - The utilities are designed to be high performance and low allocation using ArrayPool<T> and Span<T> where possible.
  • Thread-safe pools - The included object pools are designed to be thread-safe and can be used in multi-threaded source generators.