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:
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