question

MarcGraham-7285 avatar image
0 Votes"
MarcGraham-7285 asked ·

How can I get C# 8.0 in VS 2019? (community)

I downloaded VS Community edition. I tried to use an 8.0 feature and was told it was running 7.3. How can I upgrade?

For what it's worth, here's the About data:

Microsoft Visual Studio Community 2019
Version 16.9.0
VisualStudio.16.Release/16.9.0+31025.194
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Community

Visual C++ 2019 00435-60000-00000-AA954
Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019 16.9.687.37626
ASP.NET and Web Tools 2019

Azure App Service Tools v3.0.0 16.9.687.37626
Azure App Service Tools v3.0.0

C# Tools 3.9.0-6.21124.20+db94f4cc8c78a7cd8cf9cfdae091158d2ba9d974
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

NuGet Package Manager 5.9.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools 16.0.30201.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.9.0-6.21124.20+db94f4cc8c78a7cd8cf9cfdae091158d2ba9d974
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 16.9.0-beta.21102.9+7ce7132f1459095e635194d09d6f73265352029a
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake 1.0
Visual Studio Tools for CMake

dotnet-csharpvs-setup
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TimonYang-MSFT avatar image
0 Votes"
TimonYang-MSFT answered ·

Please check the documentation: C# language versioning

C# 8 is available in .Net Core 3.x and .NET Standard 2.1 and later versions.

You can type #error version anywhere in the code, then hover your mouse over the version, and then you will see the c# version currently in use.

76956-capture.png


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


capture.png (6.8 KiB)
· 12 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have .NET Core 3.1 and .Net 5.0. runtime and SDK. It does not help. Language version is still 7.3

0 Votes 0 ·
Castorix31 avatar image Castorix31 MarcGraham-7285 ·

Did you try "Override a default" from the MSDN link ?


0 Votes 0 ·

I don't know where that option is.

I downloaded and executed: dotnet-sdk-5.0.201-win-x64.exe

I'm still seeing:

Severity Code Description Project File Line Suppression State
Error CS8304 Compiler version: '3.9.0-6.21124.20 (db94f4cc)'. Language version: 7.3. HelloWorld C:\Users\Marc\source\repos\HelloWorld\HelloWorld\Form1.cs 19 Active

0 Votes 0 ·
Show more comments