- Official Docs: Incremental Generators
- .NET 6 inprovement
- API Client with C# Source Generators
- Source Generators Cookbook
- Introducing Source Generators
- FAQ (video)
- Video
Add: ReferenceOutputAssembly="false" OutputItemType="Analyzer"
to the ProjectReference entry
<ItemGroup>
<ProjectReference Include="xxx.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
</ItemGroup>
Properties of the Genetator code:
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeSource>True</IncludeSource>
<IncludeSymbols>True</IncludeSymbols>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
<!--<AnalysisLevel>6.0-all</AnalysisLevel>-->
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<IsRoslynComponent>true</IsRoslynComponent>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
<IsRoslynComponent>true</IsRoslynComponent>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>
Project configuration (for debug)
- NSwagStudio
- Mapperly (object mapping)
- DevTeam/Pure.DI
- Data Builder Generator (Fluent API)
- SimpleSIMD
- SpreadCheetah (Excel Generator - forward only)
- GraphQL.Tools (from gql -> .NET classes)
- Generator.Equals
- ScenarioTests
- HttpClientCodeGenerator
- Refit: The automatic type-safe REST library
- Source Generator Samples (GitHub)
- Doc & Sample collection
- 101 public repositories
- CSV C# Source Generator samples
- Mapping at build time
-
Analyzer (which could be migrate to Code Gen):