A bug kept occuring in my website that was telling me a certain field/column didn't exist. It took me about 2 hours to track this bug down because it was occuring in a part of the .aspx file that I would have never even thought to look. It was occuring because of a control(ListView I believe) that had been "completely" commented out using the <!-- --> tags. The text was all green which gave me the re-assuring feeling that this code would not be included in the website. I finally decided to search my entire .aspx page for any occurences of the variable it kept insisting couldn't be "databound" and sure enough it was inside a template of a ListView control that was commented out. I changed the name of the field it kept telling me didn't exists and the bug disappeared. Im writing this question from memory so my details are somewhat sketchy but I do know one thing. It took me 2 hours to track down a bug because code that had been commented out was being compiled inside an .aspx file. So my basic question is why does this happen? Im sure this can't be a bug otherwise Microsoft would have already discovered it. Is there a configuration option I can set in Visual Studio? I couldn't find it.
View Complete Post