The Roslyn end-user preview is a VSIX (Visual Studio extension), but it replaces the compilers in the system .NET Framework installation, such that involving csc.exe from the command-line will begin using Roslyn.
Is it possible to install the Roslyn csc.exe on a computer without Visual Studio installed? How?
(Yes, Roslyn works with Visual Studio 2013 Express, so licensing is not an issue. But disk space IS. Even the Express edition has a very large footprint compared to say SharpDevelop.)
To install Roslyn compilers without installing Visual Studio, you need to download and install Microsoft Build Tools. Roslyn can also be downloaded from Github, then you can compile and get binary files csc.exe and vbc.exe, which can be accessed from the command line.
NET Compiler Platform (Roslyn) Analyzers inspect your C# or Visual Basic code for style, quality, maintainability, design, and other issues. This inspection or analysis happens during design time in all open files. Analyzers are divided into the following groups: Code style analyzers are built into Visual Studio.
NET Compiler Platform, also known by its codename Roslyn, is a set of open-source compilers and code analysis APIs for C# and Visual Basic (VB.NET) languages from Microsoft.
MSBuild versions follow Visual Studio versions, so RoslynCodeTaskFactory is available in Visual Studio 2017 version 15.8 and higher.
Take a look at the CompilerPackage sources to see how we install the compiler on your machine when you install the preview VSIX. The trick is we drop some MSBuild files in AppData\Local\Microsoft\MSBuild\12.0\<target name>\ImportAfter
. These files are loaded automatically in any C# or VB.NET build. In them, we change the corresponding CscToolPath
or VbcToolPath
to a path that contains the Roslyn compilers. There's also some additional trickery to deal with multiple hives in the scenario if you had different versions of the compilers installed in different experimental hives in VS.
So if you take a look at that, create those same .target files and edit them to point to some place where you've dropped rcsc
and rvbc
, it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With