A curated list of Roslyn books, tutorials, open source projects, analyzers, code fixes, and refactorings.
Roslyn, officially named .NET Compiler Platform, is a set of open-source compilers and code analysis APIs for C# and Visual Basic .NET languages.
- Books
- Tutorials
- Open Source Projects
- Open Source Analyzers, Code Fixes, and Refactorings
- Blog Posts and Articles
Awesome books to give you a good start with Roslyn.
- Roslyn Succinctly by Alessandro Del Sole (free e-book)
- .NET Development Using the Compiler API by Jason Bock
- Roslyn Cookbook by Manish Vasani
Awesome online tutorials to help you write your first analyzers and code fixes.
- Learn Roslyn Now - A 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 :-)
- 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 syntax transformation.
- C# and Visual Basic - Use Roslyn to Write a Live Code Analyzer for Your API - A bit older but still not outdated, very detailed MSDN article on writing code analyzers.
- C# - Adding a Code Fix to Your Roslyn Analyzer - The sequel of the previous MSDN article. A detailed introduction into code fixes.
Awesome open source projects built on top of Roslyn.
- Code Converter - Converts code from C# to VB.NET and vice versa.
- CodeAnalysis.CSharp.PatternMatching - Simplifies C# syntax and semantic analysis by providing an intuitive pattern matching for Roslyn syntax trees.
- FlubuCore - Fluent Builder. A cross platform build automation tool for building projects and executing deployment scripts using C# code.
- MirrorSharp - An online C#, VB.NET, and F# code editor. Features code completion, method signature help, quick fixes, and diagnostics.
- OmniSharp - Enables a cross platform .NET development in the editor of your choice. A family of open source projects, each with one goal: To enable a great .NET experience in your editor of choice.
- roslyn-linq-rewrite - Compiles C# code by first rewriting the syntax trees of LINQ expressions using plain procedural code. This increases performance by minimizes heap allocations and dynamic dispatch.
- RoslynPad - A cross-platform C# editor. Features code completion, method signature help, quick fixes, and diagnostics.
- RoslynQuoter - A tool that for a given C# program generates syntax tree API calls that construct the syntax tree of that program.
- scriptcs - Turns C# into a powerful scripting tool. Features C# REPL, installation of NuGet packages, execution of scripts with a single line of code.
- Sharpen - A Visual Studio extension that intelligently introduces new C# language features into your existing code base.
- SharpLab - .NET code playground. Displays intermediate steps and results of code compilation. Shows the code as compiler sees it. Allows selecting different branches and versions of Roslyn. Runs C#, VB.NET, and F# code in the browser.
- Testura.Code - A wrapper around the Roslyn API used for generation, saving and compiling C# code. Provides methods and helpers to generate classes, methods, statements and expressions.
Awesome open source analyzers, code fixes, and refactorings.
- .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.
- Code Cracker - An 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 (https://csharpcodingguidelines.com/).
- Refactoring Essentials for Visual Studio - Refactorings, analyzers and code fixes for C# and VB.NET.
- Roslyn Clr Heap Allocation Analyzer - A C# heap allocation analyzer that can detect explicit and many implicit allocations like boxing, display classes a.k.a closures, implicit delegate creations, etc.
- Roslynator - A collection of 190+ analyzers and 190+ refactorings for C#. Covers coding style, code readability and simplification, removing redundancies, fixing compiler errors and many more.
- StyleCop Analyzers for the .NET Compiler Platform - A port of StyleCop rules to Roslyn.
- VSDiagnostics - A collection of code-quality analyzers. Covers usages of async methods, flags enums, best practices in exception handling as well as many other code-quality checks.
Awesome blog posts and online articles covering various topics like performance, Roslyn internals and similar.
- Inside the .NET Compiler Platform – Performance Considerations during Syntax Analysis (#SpeakRoslyn) - An in-depth look at Roslyn's performance with the focus on memory consumption.
- Persistence, Facades and Roslyn's Red-Green Trees - An 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 - An excellent explanation why ReSharper will not use Roslyn. A good discussion on static code analysis and the limits of Roslyn.
- Roslyn performance (Matt Gertz) - An insight on how Roslyn team approaches the topic of evaluating and achieving performance.
Contributions are welcome :-) The goal is to build a categorized community-driven collection of very well-known resources. Before contributing, please read the contribution guidelines.
To the extent possible under law, Igor Rončević has waived all copyright and related or neighboring rights to this work.