Roslyn: First Steps

Roslyn, AKA the .Net Compiler Platform, is used in Visual Studio 2015 for the C# and Visual Basic compilers. MS Blog. My motivation is that I want a simple, small C# compiler footprint that I can use with Visual Studio Code.

Now Visual Studio is anything but lightweight (they REALLY got this naming wrong between VS and VS Code)… but if you go to Roslyn on GitHub, download Nuget.exe as Raw, go to Powershell I guess as Administrator, and run this:

.\nuget.exe install Microsoft.Net.Compilers

then you get the csc.exe and its dependencies.

Screenshots to cover all that:

Nuget01

Nuget02

Nuget03

Nuget04

Nuget06

Nuget05

Nuget07

NugetRoslyn08

NugetRoslyn09

NugetRoslyn10

OmniSharp01

OmniSharp02 OmniSharp03

OmniSharp04

OmniSharp05

OmniSharp06 OmniSharp07

Compilation using csc.exe

We then come to actually compiling something trivial. msdn guidance here.

This is a linked page from there to the simplest possible console app. Just SO disappointing in a page about VS2015, they’re using a Windows Batch script to wrap it and not PowerShell. Anyhoo… if you have this content:

(tidy up another time)

Link to the Roslyn wiki on GitHub: https://github.com/dotnet/roslyn/wiki/FAQ

Advertisements

4 thoughts on “Roslyn: First Steps

  1. Pingback: Back to the future – Roslyn for IRC | meatRay

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s