I had this same issue, and I was finally able to get the site to build.
I had to create another Master Page for the ASP.NET project with a different name, copy and paste the content of the original into the new one, make all of my Child forms inherit from the new Master Page, and delete the old Master Page.
The website will run now. I don't know how the debugger got confused and started using a cached object that didn't exist. I tried everything to get it to release that cache (deleting the temp files under C:\%USER%\AppData\Local
and under C:\Windows\Microsoft.NET
, renaming the Master Page, renaming the Master class, making changes to the files to force them to reload, rebuilding the solution, add the web.config
option <compilation batch="false" debug="false"/>
) except deleting the Master Page.
Deleting the Master Page fixed it for me, but I don't understand why I had to do that.
Here is the thread where my struggles played out:
https://forums.asp.net/t/2172428.aspx