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

Step by step guide on how to debug a C# SourceGenerator in Visual Studio 2022
104 stars 9 forks source link

Roslyn component is not an option for Launch Profiles #5

Open rcmosher opened 1 month ago

rcmosher commented 1 month ago

I'm trying to follow the instructions in Microsoft Visual Studio Professional 2022 Version 17.11.3 with .NET Compiler Platform SDK installed. There isn't a "Roslyn component" option available when creating a debug launch profile. Only "Executable" and "Project." Instructions may need some updating.

I have found adding Debugger.Launch() does work when building the project as a workaround.

grbrandt commented 2 weeks ago

@rcmosher I ran into the same issue, you are simply missing the .NET Compiler Platform SDK. Just go to Tools > Get Tools and Features, select the Individual components tab and find it there. image

Can confirm it works on version 17.11.4, and I am even targeting a class library, not a console application.