Learn Roslyn Now: Part 1 Getting Roslyn

Roslyn is deployed as a NuGet package.

Navigate to: Tools > NuGet Package Manager > Package Manager Console

Paste the following: Install-Package Microsoft.CodeAnalysis

A complete walkthrough of installing other Roslyn tools maybe found below:

 

7 thoughts on “Learn Roslyn Now: Part 1 Getting Roslyn

  1. Thank you for your reply. If I don’t misunderstand your meaning that I can use only .netcore SDK and two packages (MS.CodeAnalysis & MS.CodeAnalysis.CSharp) to finish my basic C# static analysis (syntax level & semantic level) ? Also I can use MSBuildWorkspace to deal with .sln file rather than analyze single C# file again and again. I am not sure is that right? I hope you can give me some tips if I misunderstand some concepts.

    1. I’m not sure if the MSBuildWorkspace can be used. At the very least you will probably have to install MSBuild on your computer in order to use it. I’ve never actually done this on Linux or Mac myself but I know Visual Studio for Mac uses Roslyn.

      You can definitely analyze C# syntax trees cross-platform without Visual Studio. If you can’t use the MSBuildWorkspace, you might be able to use the AdHocWorkspace, but you would have to add the source files (and referenced DLLs) yourself.

      1. OK. I know how to use AdHocWorkspace to add source files(DLLs) from your blog and some other articles. I have one question that if MSBuildWorkspace have to install MSBuild compiler and what the compiler I need to use with AdHocWorkspace? As I known, VS has default csc compiler to do that. So I a am confused with that.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s