explaingit

louthy/roslyn

Analysis updated 2026-07-04 · repo last pushed 2017-04-06

C#Audience · developerComplexity · 4/5DormantLicenseSetup · hard

TLDR

Roslyn is the compiler engine for C# and Visual Basic, built by Microsoft. It lets other tools inspect and analyze code as it is written, enabling real-time error checking and code suggestions in editors.

Mindmap

mindmap
  root((repo))
    What it does
      Compiles C sharp code
      Compiles VB code
      Exposes code structure
    Use cases
      Build code analyzers
      Editor plugins and fixes
      Test new language features
    Audience
      Tool builders
      Language designers
    Tech stack
      C sharp
      VB
      NET Foundation
    Platforms
      Windows
      Linux
      Mac
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a custom code analyzer that flags rule violations in your team's codebase before it runs.

USE CASE 2

Create an editor extension that suggests fixes or highlights mistakes as programmers type.

USE CASE 3

Test and prototype new language features for C# or Visual Basic using the compiler APIs.

What is it built with?

C#Visual Basic.NET

How does it compare?

louthy/roslynatrblizzard/vtmb-sbox-mounterbabelive/windows
Stars02
LanguageC#C#C#
Last pushed2017-04-06
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity4/53/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Building from source requires Visual Studio or the .NET SDK with specific workload versions, and full build configuration is non-trivial across platforms.

Open-source under MIT license, use freely for any purpose including commercial use, as long as you keep the copyright notice.

In plain English

Roslyn is the engine behind the C# and Visual Basic programming languages. It takes the code that programmers write and translates it into instructions that a computer can actually run. Beyond just being a translator, it exposes the inner workings of that translation process so that other tools can understand and analyze code the same way a full development environment like Visual Studio does. In most programming setups, the compiler, the tool that turns human-written code into machine code, is a closed black box. You feed it text, it gives you a finished program, and you cannot see or interact with the steps in between. This project opens that box up. It provides a set of tools that let other software inspect code as it is being written, understanding the structure and rules of the language. This means a code editor can point out mistakes, suggest fixes, or enforce team rules in real time because it actually understands the logic of what you are typing. Developers who build tools, plugins, or extensions for code editors would use this. For example, if a software team wants to make sure every piece of their code handles errors in a specific way, someone could build a custom analyzer using this project. That analyzer could automatically scan the team's code and flag any spots where the rule is broken, catching mistakes before the code is ever run. Language designers also use it to discuss and test new features for the C# and Visual Basic languages. The project is maintained by Microsoft and is part of the broader .NET Foundation. It is actively tested across Windows, Linux, and Mac systems. The README points to extensive tutorials and documentation for anyone who wants to learn how to build their own code analysis tools or contribute to the project's ongoing development.

Copy-paste prompts

Prompt 1
Using the Roslyn compiler API, write a C# analyzer that flags any method that does not have a try-catch block around its body, and provide a code fix that wraps the method body in a try-catch.
Prompt 2
Create a Roslyn-based code refactor that automatically adds a CancellationToken parameter to every async public method in a project that does not already have one.
Prompt 3
Build a simple Roslyn diagnostic analyzer that detects when a string literal is used instead of a named constant, and suggest a fix to extract it into a const field.
Prompt 4
Using Roslyn's SyntaxTree API, parse a C# file and output the names of all classes and their public methods as a JSON tree structure.

Frequently asked questions

What is roslyn?

Roslyn is the compiler engine for C# and Visual Basic, built by Microsoft. It lets other tools inspect and analyze code as it is written, enabling real-time error checking and code suggestions in editors.

What language is roslyn written in?

Mainly C#. The stack also includes C#, Visual Basic, .NET.

Is roslyn actively maintained?

Dormant — no commits in 2+ years (last push 2017-04-06).

What license does roslyn use?

Open-source under MIT license, use freely for any purpose including commercial use, as long as you keep the copyright notice.

How hard is roslyn to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is roslyn for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub louthy on gitmyhub

Verify against the repo before relying on details.