There are 2 relevant questions on this site on this issue, none of them seems to go to any detail or provide any solution that has proven helpful. They are:
- The 'CodeFile' attribute cannot be used without an 'Inherits' attribute
- ASP.NET CodeFile, CodeBehind and Inherits
I am not sure what type of project this is, I believe it is a either ASP WebForms or ASP WebSite. Some more illuminated individual here may ask the correct question to figure that out, I would appreciate that.
Regardless, this issue has been happening on and off and we're never quite sure what causes it exactly nor what we've done to fix in the past. What I am sure is that I've way to many hours doing nothing but staring at this cryptic output to no avail.
Every time, the story is something like:
- Everything fine, compiling, all working ?great? (sort of, its an old project...).
- Do some changes; that works as expected.
- Do some change; that results in this error. (sometimes some git operation is involved, and this is a big suspect for me.)
- Retry compile. (Let us say, it works 9 out of 10)
- But then comes that 10th time, and no luck.
- Do ??? and it starts working (mostly restore a hard backup of the machine's project folder, done daily)
This is frustrating and counter-productive. We're never quite sure what we did that caused it or what fixed it.
Any help would be very much appreciated. Here is a screenshot of the error in Visual Studio 2019.