layout: true
--- class: center, middle # Roslyn Source Code Generator => ( press > ) https://ignatandrei.github.io/Presentations/RoslynSourceCodeGeneratorsprez.html Code at https://ignatandrei.github.io/Presentations/RoslynSourceCodeGenerators.zip --- # Agenda 0. About me 1. What is RSCG ? 3. Simple Generator Examples (generate files from CSV,XML, JSON) 4. Interacting with Code examples (TimeBomb, enum / mock / copy constructor ) 3. StackTrace with RSCG , Open Tracing, 4. Links to get started 7. Discussion / Questions ? --- class: center, top # About me ![:img ignat, 10%](ignat.jpg) Andrei Ignat http://msprogrammer.serviciipeweb.ro/ www.ASP.NET forum moderator YouTube 5 minutes .NET and tools : http://bit.ly/5MinTools Book Making Open Source Component : http://bit.ly/NetOpenSourceComponent Book Copy Paste from StackOverflow : https://amzn.to/2PQ8EDc Monthly meetings: https://www.meetup.com/Bucharest-A-D-C-E-S-Meetup/ --- class: center, top # Ebook RSCG Examples Amazon: https://amzn.to/3f6gll3 Free: https://ignatandrei.github.io/RSCG_Examples/ Github Examples: https://github.com/ignatandrei/RSCG_Examples/ --- class: center, top # What is RSCG ? https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/ C# 9 ![:img how, 80%](how.png) Demo RSCG_VerySimple : Forget Debugger.Launch => IsRoslynComponent System.Diagnostics.Debugger.Break Writing logs: DoDiagnostics Where are the files ? --- class: center, top # Simple Generator Examples (generate files from CSV,XML, JSON) Demo SourceGenerators/SourceGenerators.sln ( CSV and XML ) Demo JsonToClass ? --- class: center, top # Interacting with Code Examples ## Detailed Practical example to generate code from existing RSCG_TimeBombComment\RSCG_TimeBombComment.sln ## More examples from nuget enum / copy constructor / mock InteractingWithCode\AdvEx.sln --- class: center, top # StackTrace with RSCG , Open Tracing Demo StackTracing https://github.com/open-telemetry/opentelemetry-dotnet/issues/762#issuecomment-804958106 SourceGenerators\StackTracing\AutoTracing\AutoTracing.sln Jaeger docker run -d --name jaeger -p 5775:5775/udp -p 6831:6831/udp -p 6832:6832/udp -p 5778:5778 -p 16686:16686 -p 14268:14268 -p 14250:14250 jaegertracing/all-in-one:1.22 http://localhost:16686/ --- class: center, top # Links to get started https://github.com/dotnet/roslyn/blob/master/docs/features/source-generators.md https://github.com/dotnet/roslyn/blob/master/docs/features/source-generators.cookbook.md https://github.com/dotnet/roslyn-sdk/tree/master/samples/CSharp/SourceGenerators https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/ https://turnerj.com/blog/the-pain-points-of-csharp-source-generators # Future Integrated in .NET 6 by Microsoft : https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-5/#libraries-jsonserializer-source-generation https://docs.microsoft.com/ro-ro/dotnet/core/extensions/logger-message-generator --- class: left, top # Questions? Andrei Ignat http://msprogrammer.serviciipeweb.ro/ Amazon: https://amzn.to/3f6gll3 Free: https://ignatandrei.github.io/RSCG_Examples/ Github Examples: https://github.com/ignatandrei/RSCG_Examples/ Monthly meetings: https://www.meetup.com/Bucharest-A-D-C-E-S-Meetup/