Is it possible to install Roslyn without Visual Studio?

Roslyn's end user preview is VSIX (a Visual Studio extension), but it replaces the compilers in the installation of the .NET Framework, so turning on csc.exe from the command line will start using Roslyn.

Is it possible to install Roslyn csc.exe on a computer without installing Visual Studio? How?

(Yes, Roslyn works with Visual Studio 2013 Express, so licensing is not a problem, but the disk space is IS. Even the Express version has a very large area compared to SharpDevelop.)

+6
source share
1 answer

Take a look at the sources of CompilerPackage to find out how we install the compiler on your computer when installing VSIX Preview. The trick is that we drop the MSBuild files in AppData\Local\Microsoft\MSBuild\12.0\<target name>\ImportAfter . These files are loaded automatically into any C # or VB.NET builds. In them, we change the corresponding CscToolPath or VbcToolPath to a path containing Roslyn compilers. There are also some additional deceptions related to several hives in the script, if you had different versions of the compilers installed in different experimental hives in VS.

So, if you look at this, create the same .target files and edit them to point to where you dropped rcsc and rvbc , it should work.

+11
source

All Articles