-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support source generator debugging in the new Launch Profiles UI #850
Comments
Yeah, feel free to ping us for reviews or questions. Any issues you encounter are likely to affect others as well so we want to know about them. |
Since this is going to be the only way to view Launch Profiles in VS 2022 we will need to make a change here to fix this this month. |
fixed with #896 |
Do we have a tutorial about this somewhere ? |
@ignatandrei I record a video: source_generator.debug.mp4 |
If this option doesn't show up for you in VS2022, make sure you have the |
Can these new instructions be added to the "official" documentation for Source/Incremental Generators? I tried following the video and it is still not working for me. |
Does the dropdown menu doesn't show the option? If you can't select the target project, then check whether you have the source code generator referenced in the target project like so That's all that should be needed, including the If all that doesn't help, you can still create the launchSettings.json by yourself: {
"profiles": {
"Your.SourceCode.Generator.Name": {
"commandName": "DebugRoslynComponent",
"targetProject": "..\\TargetProject\\TargetProject.csproj"
}
}
} |
ClassLibrary3 is a .netstandard 2.0 class library that holds an IIncrementalGenerator instance. BlazorApp1 is the sandbox project that will consume that code generated by ClassLibrary3. Source generation works. Debugging as described here does not, and debugger.launch() is a pain. |
@TorreyGarland So one or multiple of your dependencies is the problem, so either remove one after another, until it works, create a new generator and add them until it doesn't work or wait for a fix. |
strange... works now perfectly with all previous dependencies on both SourceGenerators and IncrementalGenerators. I didn't update the sdk. Maybe good old fashioned restart computer worked. Thanks for quickly looking into this. |
I spoke too soon... it works perfectly for a console app. it failed with the "filename or extension is too long" message for a Blazor Server App project. |
That's the same error message discussed in dotnet/roslyn#55802. |
I'm sorry, I didn't see anything specific to blazor apps in that discussion. |
This has worked for me. I have tried to streamline the instructions here: https://github.com/JoanComasFdz/dotnet-how-to-debug-source-generator-vs2022 |
try it with blank blazor server app. does it work for you? |
I just followed my own instructions and yes it works: https://github.com/JoanComasFdz/BlazorApp1 Make sure tu put the breakpoints in the SourceGenerator Initialize and Execute methods to see it working. Also for reference: I am using VS 2022 17.1.0 |
thank you for looking into to this |
Still does not work for me. I am using VS2022 vs 17.1.1 Any idea why? |
Solved with #850 (comment) . THanks. ! |
this worked with a Blazor Server app? I have the most recent SDK and it still failed. |
I've tried this way for debugging, but got this on terminal, related to target project: But the target project compiles well on Visual Studio, and I can debug it without throubles. The files listed on Errors CS2001 really don't exist. I really don't know why it's happening. Generator launchSettings.json:
Target project's csproj file:
|
In Dev17 we have a new UI for launch profiles, which replaces the legacy
ILaunchSettingsUIProvider
interface. Rather than having each provider specify it's own UI components, we now expect data about properties in order to present a unified experience.The source generator debugger support in this repo should be extended to provide the relevant data for that experience, for launch profiles with command name
DebugRoslynComponent
.Without support, editing of source generator debugging profiles is not available for C# projects in Dev17.
Docs exist to walk through this process here: https://github.com/dotnet/project-system/tree/main/docs/repo/property-pages
In particular the doc on adding a new launch profile kind, and on property specification.
Ping @drewnoakes or @tmeschter for help if anything is unclear.
The text was updated successfully, but these errors were encountered: