The type or namespace name could not be found in your ".g.cshtml.cs" file

Last night I updated the namespace of my User class from Fan.Models to Fan.Membership (I probably should have used refactoring tool but didn't) and the web project Fan.Web stopped building.

The type or namespace name could not be found in my .g.cshtml.cs file
The type or namespace name could not be found in my .g.cshtml.cs file

These are CS0246 compiler errors all saying "type or namespace name could not be found" and pointing to my ".g.cshtml.cs" files.

The actual issues are in the .cshtml files, but Visual Studio points to the compiled version of those .cshtml file. Moreover clicking on these errors in Visual Studio will not open up either .cshtml or .g.cshtml.cs file.  So for a moment I was hanging and guessing on what I should do.

My first response was that compiled Razor pages got cached and didn't get cleaned out.  Then I went all over to find these files, maybe it's getting late at night.  Finally I right clicked and copied the error out to see that they are just locally in my folder src\Fan.Web\obj\Debug\netcoreapp2.1\Razor\Pages\Admin\Categories.g.cshtml.cs

To sum up, Razor pages are compiled into these C# .g.cshtml.cs files, they are located right in your web project's "...\obj\Debug\netcoreapp2.1\Razor\Pages\...".  If your .cshtml pages have namespaces that you just renamed, Visual Studio won't point you to .cshtml but to the compiled version instead.