Visual Studio 2017 (15.x) 支持 C# 7,但是 Visual Studio 呢2015 (14.x)?
我如何使用 C# 7?
您可以通过安装 Nuget 包来替换 Visual Studio 附带的编译器以支持 C# 7 版本Microsoft.Net.编译器 https://www.nuget.org/packages/Microsoft.Net.Compilers/:
引用此包将导致使用以下命令构建项目
中包含的 C# 和 Visual Basic 编译器的特定版本
包,而不是任何系统安装的版本。
There is no indication that I can see on the package page as to whether this is officially supported in Visual Studio 2015. My not-thorough tests so far indicate that it works but not painlessly - C# 7 code compiles, but is underlined with the red squiggly line which indicates a syntax error:
Note that you will also need to install the Nuget package System.ValueTuple https://www.nuget.org/packages/System.ValueTuple/ to use the new C# 7 value tuples features.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)