How do I upgrade to C# 8?
I figured you just download the latest VS and that's it, you've got the latest version of C#, but today I got an error when trying to set a property to readonly, saying "Feature 'readonly members' is not availble in C# 7.3. Please use language version 8.0 or greater."
So it seems I'm using version 7.3, how do I upgrade?
Thanks
Re: How do I upgrade to C# 8?
What version of Visual Studio are you using?
Re: How do I upgrade to C# 8?
Quote:
Originally Posted by
Zubon
I figured you just download the latest VS and that's it, you've got the latest version of C#, but today I got an error when trying to set a property to readonly, saying "Feature 'readonly members' is not availble in C# 7.3. Please use language version 8.0 or greater."
So it seems I'm using version 7.3, how do I upgrade?
Thanks
I see, so VS uses .NET Core 2 by default and I need to upgrade to .NET Core 3.
I have VS version 16.4.5, .NET Core 3 should be installed with this version. I don't get any option to choose which version of .NET Core to use when starting a new project though. How do I change to .NET Core 3? If I started a project with .NET Core 2 can that project be updated to use .NET core 3? Thanks for your useful advices.
Re: How do I upgrade to C# 8?
Download the .net core 3.1 sdk and install it.
Re: How do I upgrade to C# 8?
o target different/latest c# version (. NET Core 3 and C# 8)
Open the project properties window (right click on project, select properties)
Select 'Build' from the left hand side options.
Scroll down to the Advanced options.
Select the desired version of c#, click ok.
Hope this information is helpful to you