Automate yourself out of a job with Roslyn
summary
Shows using Roslyn plus Microsoft.Build.Locator and MSBuildWorkspace to load .sln files, then reads SyntaxTrees and uses a SemanticModel to disambiguate types (system.string vs domain types). Demonstrates faster traversal with a CSharpSyntaxWalker vs LINQ queries, builds a CSharpSyntaxRewriter to append .ToUpperInvariant to literal strings (handles immutability by producing a new Solution and calling workspace.ApplyChanges), and describes a real project that auto-generates gRPC protobuf and adapter code from WCF contracts — it works, but needs autogenerated-file and symbol checks.
AI-written summary · about
chapters (8)
- 0:00Start
- 1:16Write Code that Writes Code with Roslyn
- 3:12Roslyn & Visual ReCode
- 15:48Syntax Trees
- 20:32Navigating Syntax
- 31:00Semantic Models
- 44:05Finding all used types
- 52:59Rewriting Code
related talks
01h 00mAutomate Yourself Out of a Job with Roslyn
01h 08mAnalyzing source code using Roslyn
01h 01mWriting Code with Code: Getting Started with the Roslyn APIs
30mRoslyn for teamlead.If something takes more than 5 minutes -write a script.
01h 02mUse your source code to document your application
01h 01mThe Power of Roslyn
57mRoslyn: The Craft of Static Analysis
54mContinuous Integration: Live Static Analysis using Visual Studio & the Roslyn API
