简体   繁体   English

其中.Net Framework版本C#7.2可用

[英]In Which .Net Framework Version C# 7.2 is Available

I tried installing .net framework 4.7.2 , still the target framework is empty in the project properties. 我尝试安装.net框架4.7.2 ,目标框架在项目属性中仍为空。 The program I'm trying to run uses readonly struct , which is part C# 7.2 . 我正在尝试运行的程序使用readonly struct ,它是C#7.2的一部分。

Could you please guide me .Net Framework version has C# 7.2 ? 你能指导我.Net Framework版本有C#7.2吗?

Language features are independent of .Net version (Framework/Core/Standard). 语言功能独立于.Net版本(Framework / Core / Standard)。

You will need to use a compiler that understands the newer language features. 您将需要使用能够理解新语言功能的编译器。 Assuming you're using Visual Studio 2017, you should update to latest version. 假设您使用的是Visual Studio 2017,则应更新到最新版本。

By default C# projects in Visual Studio use the latest major release of the language (which would be 7.0 as of this writing). 默认情况下,Visual Studio中的C#项目使用该语言的最新主要版本(在撰写本文时为7.0)。 To change this, open up the project's properties, select the Build page, click Advanced... , and under General set Langauge Version to "C# 7.2". 要更改此设置,请打开项目的属性,选择Build页面,单击Advanced ... ,然后在General set Langauge Version将其设置为“C#7.2”。

Per phuzi's comment mentioning this question , you might need to update to the latest Visual Studio in order to see this option. 根据phuzi的评论提到这个问题 ,您可能需要更新到最新的Visual Studio才能看到此选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM