This appendix provides a quick reference for the environment required for source generator development. Use it when reconstructing the environment after completing the main tutorial. For detailed explanations of each item, refer to Part 1-01. Development Environment Setup .
Tool Minimum Version Purpose .NET SDK 10.0 Source generator build and test Visual Studio 2022 17.12+ IDE (source generator debugging support) VS Code + C# Dev Kit Latest Alternative IDE
# Example output: 10.0.100
Package Purpose Microsoft.CodeAnalysis.CSharpRoslyn C# compiler API (Syntax, Semantic) Microsoft.CodeAnalysis.AnalyzersAnalyzer development rule validation
Both packages should specify PrivateAssets="all" to prevent transitive dependency to consumer projects.
Property Value Description TargetFrameworknetstandard2.0Required target for compatibility across all IDE/CLI environments IsRoslynComponenttrueRecognized as a source generator component EnforceExtendedAnalyzerRulestrueEnforces analyzer packaging rules IncludeBuildOutputfalseExcludes build output from NuGet package distribution
< ProjectReference Include = " ..\MySourceGenerator\MySourceGenerator.csproj "
OutputItemType = " Analyzer "
ReferenceOutputAssembly = " false " />
Property Description OutputItemType="Analyzer"Recognized as an analyzer/generator ReferenceOutputAssembly="false"Excludes runtime reference (compile-time only)
< ProjectReference Include = " ..\MySourceGenerator\MySourceGenerator.csproj "
ReferenceOutputAssembly = " true " />
In test projects, set ReferenceOutputAssembly="true" to allow the debugger to step into the source generator internals.
→ Part 1-01. Development Environment Setup