可以在没有Visual Studio的情况下安装Roslyn最终用户预览吗? [英] Can Roslyn end-user preview be installed without Visual Studio?

查看:58
本文介绍了可以在没有Visual Studio的情况下安装Roslyn最终用户预览吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Roslyn最终用户预览版是VSIX(Visual Studio扩展),但是它替换了系统.NET Framework安装中的编译器,因此从命令行涉及csc.exe将开始使用Roslyn.

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.

是否可以在未安装Visual Studio的计算机上安装Roslyn csc.exe?怎么样?

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

(是的,Roslyn与Visual Studio 2013 Express一起使用,因此许可不是问题.但是磁盘空间是IS.与SharpDevelop相比,即使Express版本也具有很大的占用空间.)

(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.)

推荐答案

看看 CompilerPackage来源,以了解在安装预览VSIX时我们如何在您的计算机上安装编译器.诀窍是我们将一些MSBuild文件放在 AppData \ Local \ Microsoft \ MSBuild \ 12.0 \<目标名称> \ ImportAfter 中.这些文件会在任何C#或VB.NET版本中自动加载.在其中,我们将相应的 CscToolPath VbcToolPath 更改为包含Roslyn编译器的路径.如果您在VS中的不同实验配置单元中安装了不同版本的编译器,则在此方案中还存在一些其他技巧来处理多个配置单元.

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.

因此,如果您看一下,请创建相同的.target文件,然后将其编辑为指向放置 rcsc rvbc 的某个位置,应该可以.

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.

这篇关于可以在没有Visual Studio的情况下安装Roslyn最终用户预览吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆