Guide · Open source
How to use Roslyn: clone, build and explore the .NET compiler
Updated · written with AI from the project's own documentation and checked against our catalogue data
Roslyn is the open-source implementation of the C# and Visual Basic compilers, and it also exposes an API for reading and analyzing code. This guide explains what it is, how to get the source from GitHub, where the documentation and contribution guides live, and who should spend time with it. By the end you will know whether Roslyn fits a code analysis or compiler-internals goal.
Quick start
- 1Decide if Roslyn fits your goal. Confirm you want to build analysis tools or study compiler internals, since the README describes a compiler platform and APIs.
- 2Clone the repository. Run the clone command from the README to get the source from GitHub.
- 3Read the architecture overview. Open the Roslyn Architecture Overview to learn the compiler API model before writing code.
- 4Read the contributing guide. Check CONTRIBUTING.md for the development workflow, debugging and test steps.
- 5Join the community. Ask questions on GitHub Discussions or the Roslyn channel on the CSharp Community Discord.
What Roslyn is and who it is for
Roslyn is the open-source implementation of both the C# and Visual Basic compilers. The compiler is the program that turns source code into running software. Roslyn also provides an API surface for building code analysis tools.
Developers use it to build code analysis tools and to understand how the compilers see their code. The README describes it as a compiler platform and set of APIs rather than an end-user application.
- Developers building code analysis or refactoring tools for .NET
- Contributors who want to work on the C# or Visual Basic compilers
- Teams curious about how .NET compilers work internally
Get the Roslyn source code
The README lists one install step: clone the repository from GitHub. It does not list other prerequisites, so check the contributing docs for the build and test workflow before you start working in the code.
git clone https://github.com/dotnet/roslynRead the Roslyn API documentation
The README points to the Roslyn Architecture Overview as the place to start with Roslyn's API. It explains the compiler API model, which is the best entry point if you plan to write analysis code against Roslyn.
Use the pre-release NuGet feeds
The README lists public NuGet feeds for the latest pre-release builds: a Compiler feed, an IDE Services feed, and a .NET SDK feed. Each feed is a separate URL, so pick the one that matches the package you need.
- Compiler feed: the dotnet-tools feed on Azure DevOps
- IDE Services feed: the vssdk feed on Azure DevOps
- NET SDK feed: the dotnet5 feed on Azure DevOps
Contribute to Roslyn
All work on the compilers happens directly on GitHub, and external contributors send pull requests that go through the same review process as core team members. Ask questions on GitHub Discussions first, then read the contributing guide.
The contributing guide covers coding guidelines, the development workflow including debugging and running tests, submitting pull requests, and finding bugs or features to work on in the IDE or Compiler. Roslyn API suggestions go through the API review process. Language feature ideas belong in the csharplang or vblang repositories.
- Coding guidelines
- Development workflow, including debugging and running tests
- Submitting pull requests
- Finding a bug or feature in the IDE or Compiler
- Roslyn API suggestions via the API review process
Get help from the community
The Roslyn community meets on GitHub Discussions, where you can ask questions, voice ideas, and share projects. There is also a Roslyn channel on the CSharp Community Discord. The Code of Conduct applies to all Roslyn community channels.
What people use it for
- Building a code analysis tool for .NET projects using the Roslyn API
- Exploring how the C# or Visual Basic compiler represents source code
- Contributing a fix or feature to the C# or Visual Basic compiler on GitHub
- Testing pre-release compiler or IDE builds from the public NuGet feeds
Frequently asked questions
Is Roslyn free to use?
The repository is licensed under the MIT licence, as shown on its GitHub page. The MIT licence is a permissive open-source licence, so check its terms for your own use case.
What are the requirements to install Roslyn?
The README lists the clone command but no prerequisites. Check the contributing docs for build and test requirements before you start working on the code.
How do I install Roslyn?
Clone the repository from GitHub with git clone https://github.com/dotnet/roslyn. The README describes this as the install method, and the compiler is typically used through existing .NET tooling.
Is there a Roslyn alternative for code analysis?
The source does not name comparable projects, so this guide cannot recommend one. Consider your needs and check the Roslyn documentation to see if its API covers them.
Why is Roslyn not working for me?
The README does not include troubleshooting steps. Ask questions on GitHub Discussions or the Roslyn channel on the CSharp Community Discord for help.
Can I use Roslyn to write C# apps without knowing compilers?
The README does not describe end-user use. Roslyn is aimed at people building code analysis tools, contributing to the compilers, or studying compiler internals.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Roslyn suits developers building code analysis or refactoring tools for .NET, contributors to the C# or Visual Basic compilers, and anyone curious about compiler internals. If you only want to write C# or VB code and need no compiler internals, you will not need to work with it directly, and if you want a ready-made application, look elsewhere.
Install options & downloads