简体   繁体   中英

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. The program I'm trying to run uses readonly struct , which is part C# 7.2 .

Could you please guide me .Net Framework version has C# 7.2 ?

Language features are independent of .Net version (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.

By default C# projects in Visual Studio use the latest major release of the language (which would be 7.0 as of this writing). 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".

Per phuzi's comment mentioning this question , you might need to update to the latest Visual Studio in order to see this option.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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