Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 799
Pandiarajan Avatar asked Jul 03 '18 12:07

Pandiarajan


People also ask

Is .NET Framework C?

No. The . NET Framework is a bunch of classes(libraries) abstracting some lower-level windows functionality. C and C++ are languages.

What version of C# is in .NET 4.7 2?

NET Framework 4.7. 2.

What version of C# is in .NET 6?

C# 10 is supported only on . NET 6 and newer versions. C# 9 is supported only on . NET 5 and newer versions.


2 Answers

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.

like image 134
phuzi Avatar answered Sep 24 '22 14:09

phuzi


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.

like image 34
Joe Sewell Avatar answered Sep 22 '22 14:09

Joe Sewell