Introduction to Roslyn and its use in program development

C#Visual BasicCompilers

Please contribute by voting. Thanks!

Roslyn is a platform which provides the developer with powerful tools to parse and analyze code. It's not enough just to have these tools, you should also understand what they are needed for. This article is intended to answer these questions. Besides this, you will find details about the static analyzer development which uses Roslyn API.

Roslyn is an open source platform, developed by Microsoft, containing compilers and tools for parsing and analysis of code written in C# and Visual Basic.

Roslyn is used in the Microsoft Visual Studio 2015 environment. Various innovations such as code fixes are implemented by means of the Roslyn platform.

Using the analysis tools provided by Roslyn, you can do a complete code parsing, analyzing all the supported language constructs.

The article can be divided into 2 logical parts:

  • General information about Roslyn. An overview of tools provided by Roslyn for parsing and analyzing the code. We provide a description of entities and interfaces, as well as the point of view of a static analyzer developer.

  • Peculiarities that should be taken into account during the development of static analyzers. Description of how to use Roslyn to develop products of this class; what should be considered when developing diagnostic rules; how to write them; an example of a diagnostic.


Article created: Dec 23 '16. Edited Dec 23 '16.


Kate Milovidova [7]  •  Mar 25 '19  •   •  Reply

It's been awhile but anyway :):

  1. Source code of Roslyn is on GitHub:

  2. As for Mono, I can't say anything. They used to have this fork, but now there's a caption that says 'This fork is no longer maintained. Original Roslyn repo now supports Mono by default. So... ('
Matt Hamilton [13]  •  Jan 23 '17  •   •  Reply

Thanks for a great article! Somewhat related questions:

  • Do you know if Roslyn is open source to 100%?
  • Does it compile and run on Mono?`


Your comment

You need to sign up / log in to comment this article


Created by Kate Milovidova [7] Dec 23 '16

Share article

Do you know about


Write an article