Source Generator for C# 9
See original GitHub issueAny plans on creating a source generator package as a next-gen NSwag.MSBuild
for C# code generation? Sounds like it would be less faff to set up in a project (no <Exec ...>
tags just a package reference, could auto-discover *.nswag files) and eliminate the irritating phantom file changes I often see to my generated client files in git.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:8
Top Results From Across the Web
Introducing C# Source Generators - .NET Blog
A Source Generator is a piece of code that runs during compilation and can inspect your program to produce additional files that are...
Read more >amis92/csharp-source-generators: A list of C# ...
C# Source Generators is a Roslyn compiler feature introduced in C#9/.NET 5. It lets C# developers inspect user code and generate new C#...
Read more >4 ways to generate code in C# — Including Source ...
A Source Generator is a piece of code that runs during compilation and can inspect your program to produce additional files that are...
Read more >Building a Source Generator for C# - InfoQ
Source generators are a good way to reduce the amount of repetitive code that needs to be written. Plan your source generator by...
Read more >Episode 15: C#9 Source Generators with Jason Bock ...
In this episode, I was joined by Jason Bock to chat about the new C#9 source generators! Writing code that writes code! We...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I implemented this for personal use, maybe it will be useful to someone as well: https://github.com/HavenDV/H.NSwag.Generator
Usage:
I recently came across an article on how to overcome this problem: https://andrewlock.net/creating-a-source-generator-part-6-saving-source-generator-output-in-source-control/