There is a similar question to this here but I believe that involves a different cause.
I moved a class from a newer project into an older project. Both were targeti
(It can applicable VS 2019 - .NET Framework 4.8 Web Application projects easily)
I have realized this issue after install DotNetCompilerPlatform v3.6
I have looked for TheColonel26's answer but I couldn't change selected language version:
Appearantly, we can not change selected language version. (For details look here)
After that I have used kfwbird's answer but with changes for newer version:
Now it works as should be.