projects

dotnet-how-to-debug-source-generator-vs2022

Step by step guide on how to debug a C# SourceGenerator in Visual Studio 2022

โญ Canonical โ€” this is the single source of truth for this project.

Overview

Field Value
Name dotnet-how-to-debug-source-generator-vs2022
Tier ๐Ÿ“š Learning & Experiments
Description Step by step guide on how to debug a C# SourceGenerator in Visual Studio 2022
Visibility ๐Ÿ”’ Private
Fork No
Last activity ย 
Status โœ… Archived
Original source Github
Original owner guneysus
Language Markdown
Type Miscellaneous
Size Small
Idea Step-by-step guide and demo for debugging C# source generators in VS2022
Idea score 55
Impl score 60
Rating 57

๐Ÿ’ก Core Idea

Step by step guide on how to debug a C SourceGenerator in Visual Studio 2022

๐Ÿ” Code Snippet

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <Nullable>enable</Nullable>
    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
    <CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
    <IsRoslynComponent>true</IsRoslynComponent>
    <LangVersion>latest</LangVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" PrivateAssets="all" />
    <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
  </ItemGroup>

  <ItemGroup>
    <None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
  </ItemGroup>

</Project>

Archive Origins


โ† dotnet-extension-methods dotnet-html-gen โ†’

Generated by scripts/generate.py ยท Back to index