I moved three .ASPX files with their associated .cs and .designer.cs files to a different folder, and changed their names. When I tried to recompile, I got the message above for 5-6 different .ASPX files, including the three that I moved. The line number in the .ASPX file was always near the top (line 10-20 or so), but on different tags each time. I also got about 250 other messages on .cs files, saying all the controls in many (perhaps all) .ASPX files do not exist.
Most articles I found about this message involved different versions of MVC, but this is not an MVC app. I did try tweaking the NuGet settings, and tried commenting out the reference in web.config to System.Web.Optimization, both without success.
I also tried excluding the offending .ASPX files from the project and re-including them. This caused the message to go away for that file, but when I excluded the last file, the same message appeared on another file, usually the next one in the project.
EDIT: Answers to several other questions address adding a missing reference, but the reference is already there in my case.