可以在没有Visual Studio的情况下安装Roslyn最终用户预览吗?

编程入门 行业动态 更新时间:2024-10-28 12:28:01
本文介绍了可以在没有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最终用户预览吗?

本文发布于:2023-11-05 08:58:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560414.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:最终用户   情况下   Visual   Studio   Roslyn

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!