awesome-roslyn
github.com/ironcev/awesome-roslyn ↗Curated list of awesome Roslyn books, tutorials, open-source projects, analyzers, code fixes, refactorings, and source generators
Use this list with your AI agent
Add the Context Awesome MCP server to Claude, Cursor, or any MCP client, then ask:
"Show me open source projects resources from awesome-roslyn"
Installation instructions →What's inside
Open Source Projects
- Bridge
C# to JavaScript transpiler. Write modern mobile and web apps in C# and run them anywhere in JavaScript.
- CodeAnalysis.CSharp.PatternMatching
Intuitive pattern matching for Roslyn syntax trees. Simplifies C# syntax and semantic analysis.
- Code Converter
C# to VB.NET and VB.NET to C# transpiler.
- CodeGeneration.Roslyn
Roslyn-based Code Generation during a build with design-time support.
- dotnet-script
Runs C# scripts from the .NET CLI, defines NuGet packages inline and edit/debugs them in VS Code.
- FlubuCore
Cross platform build automation tool for building projects and executing deployment scripts using C# code.
Tutorials
- C# - Adding a Code Fix to Your Roslyn Analyzer
The sequel to the previous MSDN article. A detailed introduction into code fixes.
- C# and Visual Basic - Use Roslyn to Write a Live Code Analyzer for Your API
Older but still not outdated, very detailed MSDN article on writing code analyzers.
- C# Source Generators
Comprehensive list of additional learning sources, samples, and experimental and productive source generators. A perfect reference once you grasp the basics.
- How To Write a C# Analyzer and Code Fix
The mother of all Roslyn tutorials :-) A realistic step-by-step introduction to syntax and semantic analysis as well as the syntax transformation.
- Introducing C# Source Generators
Original announcement of the C# 9.0 Source Generators feature. Explains what source generators are, in which scenarios they are useful, and shows how to write a simple source generator.
- Learn Roslyn Now
Series of blog posts that explore the Roslyn compiler API. It introduces the power of Roslyn through small self-contained examples. A perfect tutorial to start with :-)
Open Source Analyzers, Code Fixes, and Refactorings
- Code Cracker
Analyzer library for C# and VB.NET. Offers diagnostics in many categories like performance, coding styles, as well as some basic refactorings.
- CSharpGuidelinesAnalyzer
Reports diagnostics for C# coding guidelines (
- ErrorProne.NET
Set of analyzers and code fixes focusing on the correctness and performance of C# programs. Inspired with Google's
- Mapping Generator
Code fix that generates arbitrary complex object-object mappings. It recognizes out of the box a large number of scenarios where mappings are used. A design-time alternative to
- .NET Analyzers
GitHub organization for the development of Roslyn analyzers. Various repositories within the organization cover analyzers for ASP.NET Core, WPF, IDisposable, usages of System.Reflection, etc.
- .NET Compiler Platform ("Roslyn") Analyzers
Diagnostic analyzers developed by the Roslyn team. Initially developed to help flesh out the design and implementation of the static analysis APIs. The analyzers cover code quality, .NET Core, desktop .NET Framework, comments in code, and more.
Source Generators
- DpDtInject
Proof-of-concept of a dependency injection container that transfers huge piece of resolving logic to the compilation stage. Offers additional compile-time safety and fast runtime resolution.
- Generator.Equals
Automatically implements equality and hashing for classes and records. Supports different comparison strategies. Offers similar functionality like IL weaving-based
- JsonSrcGen
Reflection-free JSON serializer. Allows extremely fast JSON processing by generating reflection-free serializers at the compile time.
- Source Generator Playground
Online application that lets you experiment with source generators. Perfect for learning and testing your ideas. Write your own source generator or learn from built-in examples and see the generated output.
- StrongInject
Compile-time dependency injection container. Compile-time checked, reflection-free and runtime code generation free, thus fast and
- StructPacker
Low-level, lightweight and performance-focused serializer for C# struct types. Auto-generates C# serialization code to achieve peak runtime performance and efficiency.
Blog Posts and Articles
- How Microsoft rewrote its C# compiler in C# and made it open source
Roslyn's journey, presented by Mads Torgersen, the lead designer of C#. Inspiring story on how Roslyn project started and why, and what it took to make it open source.
- Inside the .NET Compiler Platform – Performance Considerations during Syntax Analysis (#SpeakRoslyn)
In-depth look at Roslyn's performance with the focus on memory consumption.
- Persistence, Facades and Roslyn's Red-Green Trees
Inspiring introduction on how Roslyn team implemented immutable, reusable trees with cheap parent references and many other goodies. Quote: "But on the Roslyn team we routinely do impossible things" :-)
- ReSharper and Roslyn: Q&A
Excellent explanation why ReSharper will not use Roslyn. Includes good discussion on static code analysis and some limits of Roslyn.
- Roslyn performance (Matt Gertz)
Insight on how Roslyn team approaches the topic of evaluating and achieving performance.
Libraries and Frameworks for Testing Analyzers, Code Fixes, and Refactorings
- Microsoft.CodeAnalysis.Testing
Library for testing analyzers and code fixes with NUnit, xUnit and MSTest frameworks. A part of
- RoslynTestKit
Lightweight framework for writing unit tests for analyzers, code fixes, refactorings, and completion providers. It's unit testing framework agnostic.
Books
- .NET Development Using the Compiler API
Book by Jason Bock. Besides analyzers and refactorings, it also explains the scripting API and provides an interesting reflection on the future of the Compiler API.
- Roslyn Cookbook
Book by Manish Vasani, a member of the Roslyn analyzers team. After covering analyzers, refactorings, and scripting in detail, the book goes in-depth explaining how to develop new C# language features and contribute to the Roslyn source code.
- Roslyn Succinctly
Talks
- The Power of Roslyn
Great talk by Kasey Uhlenhuth at NDC Oslo 2018 covering Roslyn essentials and APIs and tools for building code analyzers and fixes.
Showing a sample of 56 resources. View the full list on GitHub →