I am working in a team with a project where GitHub is used. The project type is Google Gloud Project MVC5 .NET Framework 4.5.2.
When new changes are pulled down from GitHub, the new files are not detected as the correct filetype, resulting in the Visual Studio code validation being completely abscent when editing the new files.
As seen in the picture, the issue concerns .cshtml files with Razor code but also .cs files.

As Guru Stron suggested, the old
.csprojwas not committed (The project was made in VS17 but we are now all using VS19.The issue was resolved by commiting the
.slnfile and the.csprojfile from the instance where the most recent changes had been created.