You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found it exceedingly hard to create a working generator project with a consumer project that uses the generated code in VS. Thinking of developers that have not yet worked with generators before I guess the main problem is that this documentation only provides information about the in depth logic that can be used once a generator is all setup (Pipeline, IncrementalValuesProvider, creating a NuGet package, ...), but it misses the important part of how to actually setup the project for the generator and how to reference the generator project in a consumer project to use the generated code.
I would love to see the documentation to be accessible for new developers that have not worked with SourceGenerators / have no prior knowledge on the subject.
Information I'd like to see to improve this:
How should the Generator csproj look like?
What's the minimum of properties and references I need?
How do I reference the project correctly in my consumer project?
How can I debug my generator?
Information sources that can help improve the documentation:
VS needs to be restarted when generating code
I found multiple issues that gave me ideas on what might be the issue. Looks like VS has a pretty long standing issue with generated code. #49249#48083 After this ordeal I tried the same project in Rider and it does not have any of these issues. Would be great to have a sentence in the documentation about restarting VS after generating code until that issue is fixed.
A comment on an issue currently is the best "getting started" documentation
After reading a lot of issues and blogs online I also found this comment in one of the previously mentioned issues: #49249 (comment) which was the best source for the kind of information I was lacking and I'd strongly recommend including most, if not all of this information in the documentation,
A random text on github is the documentation for debugging a generator
I was searching the web for SourceGenerators and came across the Incremental Generators which seem to replace the SourceGenerators.
https://github.com/dotnet/roslyn/blob/main/docs/features/incremental-generators.md
https://github.com/dotnet/roslyn/blob/main/docs/features/incremental-generators.cookbook.md
I found it exceedingly hard to create a working generator project with a consumer project that uses the generated code in VS. Thinking of developers that have not yet worked with generators before I guess the main problem is that this documentation only provides information about the in depth logic that can be used once a generator is all setup (Pipeline, IncrementalValuesProvider, creating a NuGet package, ...), but it misses the important part of how to actually setup the project for the generator and how to reference the generator project in a consumer project to use the generated code.
I would love to see the documentation to be accessible for new developers that have not worked with SourceGenerators / have no prior knowledge on the subject.
Information I'd like to see to improve this:
Information sources that can help improve the documentation:
VS needs to be restarted when generating code
I found multiple issues that gave me ideas on what might be the issue. Looks like VS has a pretty long standing issue with generated code.
#49249 #48083
After this ordeal I tried the same project in Rider and it does not have any of these issues. Would be great to have a sentence in the documentation about restarting VS after generating code until that issue is fixed.
A comment on an issue currently is the best "getting started" documentation
After reading a lot of issues and blogs online I also found this comment in one of the previously mentioned issues: #49249 (comment) which was the best source for the kind of information I was lacking and I'd strongly recommend including most, if not all of this information in the documentation,
A random text on github is the documentation for debugging a generator
Also regarding debugging the generator I randomly found this text on github which works wonderfully https://github.com/JoanComasFdz/dotnet-how-to-debug-source-generator-vs2022 - which I also propose to include in the documentation somehow.
The text was updated successfully, but these errors were encountered: