Are you building in debug or release mode? I ask because there are differences between these and some build errors only occur in one or the other (usually the bug is in release mode). A quick web search for something like "debug vs release build" will give you some insight.
On a project I worked on a while back I found early on that I had referential problems in release mode that didn't exist in debug mode. I had placed some user controls and web forms in sub-directories in my Website project. The problem was that a web form in one subdirectory used a user control in another subdirectory, and a web form in that subdirectory used a user control in the first subdirectory, thus creating a circular reference between these directories. Does this make sense?
It was something like the following.
Organisations\OrgDetails.aspx -> Departments\DeptartmentSearch.ascx
Departments\DeptartmentDetails.aspx -> Organisations\OrganisationSearch.ascx
The controls were in the same project so this shouldn't have been a problem, but Visual Studio complained about not being able to reference one of them when I ran the build in Release mode! It seems that while it was building code in the first directory it was trying to reference the code in the second directory, but the second directory hadn't yet been built!
I think this is a bug with release builds for website projects. I've had no such problems with other project types.