roslyn Getting started with roslyn

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Remarks

To start with Roslyn, take a look at:

Additional tools and resources

  • The Roslyn Quoter

A tool for converting an sample C# program to syntax tree API calls. The tool itself can be found here.

  • Enhanced source viewer

An easy way to view the Roslyn source code can be found here.

Installation or Setup

To start tinkering with Roslyn you will need the following NuGet packages:

  • The C# and VB compilers - Microsoft.Net.Compilers . To install it you can run the following command in the Package Manager Console:

    nuget install Microsoft.Net.Compilers

  • The Language APIs and Services - Microsoft.CodeAnalysis . To install it you can run the following command in the Package Manager Console:

    nuget install Microsoft.CodeAnalysis

Additionally it is a good to install the .NET Compiler Platform SDK Templates, that can be found here. This will get you:

  • Templates for both C# and Visual Basic that enable the creation of Analyzers, CodeFixes and stand-alone analysis tools.
  • The Syntax Visualizer tool for Visual Studio(View -> Other Windows -> Syntax Visualizer ), which is extremely usefully for examining the syntax tree of existing code.


Got any roslyn Question?