我正在尝试编译某人在使用C#6.0功能时创建的C#项目.
在以前的.NET版本中,当前的C#编译器已自动安装并准备与.NET Framework一起运行.显然,情况已不再如此.我目前在我的机器上安装了.NET 4.6.1,但调用csc告诉我:
Microsoft (R) Visual C# Compiler version 4.6.1055.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.
This compiler is provided as part of the Microsoft (R) .NET Framework, but only
supports language versions up to C# 5, which is no longer the latest version. Fo
r compilers that support newer versions of the C# programming language, see http
://go.microsoft.com/fwlink/?LinkID=533240
Run Code Online (Sandbox Code Playgroud)
该链接将我转发给Github上的Roslyn项目.它似乎没有提供任何二进制版本.
奇怪的是,谷歌搜索C# 6.0 compiler提出了几个关于如何向Visual Studio 2013添加C#6.0支持的讨论(一致性或多或少你不能),以及无数文章介绍C#6.0的新功能(不可否认的精彩) ,但没有提示如何获得C#6.0的编译器.
那么:我如何获得MS C#6.0编译器,如果需要,还可以获得必要的构建工具,例如当前版本的MSBuild?
请注意,我通常不安装Visual Studio,因为SharpDevelop似乎比我的目的更优越,所以当我已经拥有框架只是为了获得最新的编译器时,我担心安装几千兆字节的数据.
Wue*_*ueF 10
要在不使用Visual Studio的情况下安装最新版本,请运行以下nuget命令行之一:
Run Code Online (Sandbox Code Playgroud)nuget install Microsoft.Net.Compilers # Install C# and VB compilers nuget install Microsoft.CodeAnalysis # Install Language APIs and Services要获得每月发布一次的最新"预览"下拉,请将
-pre开关添加到nuget命令.
| 归档时间: |
|
| 查看次数: |
15629 次 |
| 最近记录: |