I have never thought of this as a bug; I often open an aspx file within an unrelated project - only to view the code. I really wouldn't appreciate it if it started to attribute it to the project.
Anyway, currently you do need to open it in the context of a web project, no solution needed.