Roslyn (compiler)

Print Print
Reading time 5:54

.NET Compiler Platform (Roslyn)
Original author(s)Microsoft
Developer(s).NET Foundation
Stable release
Visual-Studio-2019-Version-16.7.3 / September 4, 2020; 9 months ago (2020-09-04)
Written inC#, Visual Basic
Operating systemMicrosoft Windows, Linux
PlatformIA-32, x86-64
LicenseMIT License

.NET Compiler Platform, also known by its nickname Roslyn,[1] is a set of open-source compilers and code analysis APIs for C# and Visual Basic (VB.NET) languages from Microsoft.[2]

The project notably includes self-hosting versions of the C# and VB.NET compilers – compilers written in the languages themselves. The compilers are available via the traditional command-line programs but also as APIs available natively from within .NET code. Roslyn exposes modules for syntactic (lexical) analysis of code, semantic analysis, dynamic compilation to CIL, and code emission.[3]


The most notable primary features of Roslyn include:[citation needed]

  • Compilers for the C# and Visual Basic languages exposed as services via APIs.
  • APIs for code analysis and refactoring.


The code name "Roslyn" was first written by Eric Lippert (a former Microsoft engineer[4]) in a post[5] that he published to hire developers for a new project. He first said that the origin of the name was because of Roslyn, Washington, but later in the post he speaks ironically about the "northern exposure" of its office. The city of Roslyn was one of the places where the television series Northern Exposure was filmed.[6]

Microsoft made a community technology preview (CTP) available for public download in October 2011. It installed as an extension to Visual Studio 2010 SP1.[7]

The CTP was updated on September 2012[8] to include many updates to the Roslyn APIs introduced in the June 2012 and October 2011 CTPs, including breaking changes.[9] While the June 2012 CTP API is complete for the compilers, not all features were implemented for the C# and VB.NET languages.[10]

At the Build 2014 conference in San Francisco April 2014, Microsoft made the "Roslyn" project open-source and released a preview of the language integration for Visual Studio 2013. As of April 3, 2014, Roslyn is under the Apache License 2.0.[2] The project was effectively transferred under the stewardship of the newly founded .NET Foundation.[11] At the same conference, Xamarin announced that they are working on integrating the new compilers and tools in Xamarin Studio.[citation needed]

The compilers were not feature-complete in this release. Each of the compilers contains features that are planned for the coming language versions (C# 6 and Visual Basic.NET 14). The APIs are also available through the NuGet package manager.[citation needed]

Roslyn's first RTM release was with Visual Studio 2015.[12] Roslyn currently only supports VB and C#, and the compilers were written in their respective languages.[13]

In January 2015, Microsoft moved the Roslyn source code from CodePlex to GitHub.[14]


Traditionally compilers have been a black box for application developers[dubious ]. With increasing complexity and demands for source code analysis in modern integrated development environments, however, compilers need to expose application programming interfaces (APIs) that will help developers to directly perform phases of compilation such as lexical and syntactic structure analysis of source code. Roslyn was designed with that intent from the beginning. This reduces the barrier in developing tools specifically designed for source code analysis. APIs of Roslyn are of three types: feature APIs, work-space APIs and compiler APIs. Feature APIs allow source code tool developers to do code refactoring and fixes. Work-space APIs allow plugin developers to perform actions specifically required in integrated development environments (IDEs) like Visual Studio such as finding references of a variable or code formatting. Compiler APIs allow even more sophisticated analysis of source code, by exposing direct calls to perform syntax tree and binding flow analysis.[15] Using an open-source implementation of Common Language Infrastructure (CLI) such as .NET Core, Roslyn will be able to compile in a platform-agnostic manner capable of running CLI code in Linux, OS X, and Windows.[citation needed] /

See also

  • List of compilers
  • Phoenix (compiler framework)


  1. ^ "C# and Visual Basic - Use Roslyn to Write a Live Code Analyzer for Your API". Retrieved January 7, 2019.
  2. ^ a b .NET Compiler Platform ("Roslyn") on GitHub
  3. ^ Neil McAllister, Microsoft's Roslyn: Reinventing the compiler as we know it, DEVELOPER_WORLD, 2011-10-20
  4. ^ "Fabulous adventures in coding". About Eric Lippert. Eric Lippert.
  5. ^ "Hiring for Roslyn". Eric Lippert's MSDN blog. Eric Lippert. December 16, 2010.
  6. ^ Muir, Pat (October 5, 2014). "Roslyn hopes new TV show brings 15 more minutes of fame". Yakima Herald. Archived from the original on November 2, 2014. Retrieved November 1, 2014.
  7. ^ Microsoft "Roslyn" CTP Archived April 18, 2012, at the Wayback Machine, Microsoft Download Center
  8. ^ Microsoft "Roslyn" CTP, Microsoft Download Center
  9. ^ What's New in the Microsoft "Roslyn" September 2012 CTP, Visual Studio vNext Forums
  10. ^ Known Limitations and Unimplemented Language Features, Visual Studio vNext Forums
  11. ^ .NET Foundation – Open Source Foundation for the .NET Community
  12. ^ Visual Studio 2015 RTM, 2015-07-20
  13. ^ Microsoft Roslyn vs. CodeDom
  14. ^ We're moving to GitHub!, MSDN VBTeam Blog, 2015-01-10
  15. ^ Overview of Roslyn from GitHub documentation

External links

Edited: 2021-06-18 14:10:17