OSS Tanbou

use the C# and Visual Basic compilers plus syntax and semantic models to build analyzers, code fixes, and code-generation tools

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
20,702
Primary language
C#
License
MIT
Repository last updated
Oct 3, 2026
On this page

Overview

Roslyn is the open-source implementation of the C# and Visual Basic compilers and the .NET Compiler Platform API surface. It exposes syntax trees and semantic compiler models so analyzers, code fixes, refactorings, source generators, and other developer tools can use the same language understanding as the compiler.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Work with compiler syntax trees for C# and Visual Basic

The Syntax API exposes full-fidelity, immutable syntax trees created by the same parser used by the compiler, with nodes, tokens, and trivia available for analysis.

Sources: [1][2]

Build code-analysis tools on the compiler's language model

Roslyn APIs let tools reason about code using compiler structures instead of relying only on source-text heuristics.

Sources: [1][2]

Consume compiler APIs through NuGet packages

Applications can reference packages such as Microsoft.CodeAnalysis.CSharp and parse source with APIs such as CSharpSyntaxTree.ParseText. As of October 4, 2026, the current stable C# package is 5.9.0.

Sources: [3][2]

Best fit

Fits analyzers, generators, refactorings, and migration tooling for C# code

It is useful when linting, code generation, IDE extensions, migrations, or source transformations need compiler-accurate syntax or semantic understanding.

Sources: [1][2]

Before adoption

Do not use GitHub Releases latest as the current Roslyn version

GitHub Releases still reports v4.0.1 from 2021 as latest, while stable 5.x packages continue to ship on NuGet. Use NuGet and the target .NET SDK as the package-version authority.

Sources: [4][3]

Match compiler API packages to the analyzer or tooling host

Visual Studio, the dotnet SDK, and build servers host particular Roslyn versions. Large package-version gaps can create API compatibility or assembly-loading problems, so choose packages with the deployment host in mind.

Sources: [1][3]

Treat syntax trees as immutable during transformations

Roslyn syntax trees are immutable, so transformations construct replacement nodes or new trees rather than mutating the existing syntax graph.

Sources: [2]

Official sources

  1. [1]Roslyn README(2026-10-04)
  2. [2]Roslyn C# Syntax Analysis walkthrough(2026-10-04)
  3. [3]Microsoft.CodeAnalysis.CSharp 5.9.0 on NuGet(2026-10-04)
  4. [4]Roslyn GitHub latest release v4.0.1(2026-10-04)
  5. [5]Roslyn MIT license(2026-10-04)
Supplemental curator note

GitHub Releases still reports v4.0.1 from 2021 as the latest release, so it is not a reliable current-version source. For package consumers, use NuGet and the target .NET SDK as the release authority; as of October 4, 2026, Microsoft.CodeAnalysis.CSharp 5.9.0 is the current stable package.

Try it in 3 steps

  1. 1

    Create a console project for code analysis

    Create a minimal .NET console project for exercising Roslyn APIs.

    dotnet new console -n RoslynDemo -f net10.0
  2. 2

    Add Microsoft.CodeAnalysis.CSharp 5.9.0

    Pin the stable package current on October 4, 2026. GitHub Releases latest v4.0.1 is not the current package version.

    dotnet add RoslynDemo/RoslynDemo.csproj package Microsoft.CodeAnalysis.CSharp --version 5.9.0
  3. 3

    Parse C# source and print the root syntax kind

    Use the same Syntax API family as the compiler to parse source text and verify that a syntax tree is produced.

    printf 'using Microsoft.CodeAnalysis.CSharp;\nvar tree = CSharpSyntaxTree.ParseText("class Demo { int X; }");\nConsole.WriteLine(tree.GetRoot().Kind());\n' > RoslynDemo/Program.cs && dotnet run --project RoslynDemo/RoslynDemo.csproj
Check the official README

Growth

Growth trends · Last 30 days

20,702 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
282
Open PRs
742

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • roslyn
  • visual-basic
  • visual-studio
  • csharp
  • hacktoberfest
Stars
20,702
Forks
4,334
Watchers
985
Open issues
5,958
Contributors
265
Owner type
Organization
Primary language
C#
License
MIT
Repository last updated
Oct 3, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?