Intermediate C#
Q58 / 100

What is a source generator in C#?

Correct! Well done.

Incorrect.

The correct answer is B) A Roslyn API that generates additional C# source code during compilation based on existing code analysis

B

Correct Answer

A Roslyn API that generates additional C# source code during compilation based on existing code analysis

Explanation

Source generators (IIncrementalGenerator) run during compilation and add generated files to the project. Used by System.Text.Json, regex source gen, and DI containers.

Progress
58/100