I am developing a website using the latest version of VS2019 (16.4.5) and I am targeting the .NET Framework 4.7.2.
However, I have this kind of code in my Razor views
@(Model.Data?.Title)
which keeps giving me
Feature 'null propagating operator' is not available in C# 4. Please use language version 6 or greater
I thought that by using VS2019 and targeting .NET Framework 4.7.2, I would be at least using C#6. In this version of VS, you can not even have access to the version of C# through Project Properties > Build > Advanced > Language version as it is now greyed. Instead, I have "Automatically selected based on framework version"...
I have also checked my compiler and I have Microsoft.CodeDom.Providers.DotNetCompilerPlatform 2.0.1 Nuget package so it sounds fine to me.
Based on this article, I should be at least in 7.3 for the C# version so why do I keep getting this error?