visual studio 2019 version c# probleme

I can not change the version of C # on visual studio 2019

I tried to go to the property to access a window that normally allowed to change the version of C #

Error CS8025 The 'local functions' feature is not available in C # 4. Use version 7.0 or later.


Solution 1:

I'm assuming you're using .Net Core. Within the .csproj file for your start-up project (executable, web, web API, whichever it is in your case), add the following:

<PropertyGroup> <LangVersion>latest</LangVersion> </PropertyGroup>

See the docs for more details.

Solution 2:

  • Right click on your csproj in the solution explorer.
  • Select properties.
  • Select 'Build' near the top left of the screen.
  • Click 'Advanced' in the main window (scroll down if you can't see it).
  • Change language version to latest minor version.