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?
No. The . NET Framework is a bunch of classes(libraries) abstracting some lower-level windows functionality. C and C++ are languages.
NET Framework 4.7. 2.
C# 10 is supported only on . NET 6 and newer versions. C# 9 is supported only on . NET 5 and newer versions.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With