NServiceBus icon indicating copy to clipboard operation
NServiceBus copied to clipboard

Provide SourceGenerator as well as the new Incremental Source Generator for better performance

Open danielmarbach opened this issue 3 years ago • 0 comments

The incremental source generators allow optimizing the code generation strategies for faster execution, which greatly benefits the overall IDE experience. It is possible to share common code between both approaches and then package the source generator for Roslyn3.x for backward compatibility and the incremental source generator for Roslyn4 together into the same package.

image (3)

How that is done can be seen in

https://github.com/dotnet/runtime/tree/main/src/libraries/System.Text.Json/gen

The other trick to make it work for older versions that don't support "Roslyn Component Versioning" is the targets file they include in the package's build folder

See also https://github.com/dotnet/sdk/issues/20355

danielmarbach avatar Jan 18 '22 16:01 danielmarbach