This is not so much a bug as a difference in compilation models between web sites and web application projects. See the profile topic in the following for some more info:
http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx
The basic issue is that profiles are compiled dynamically by ASP.Net. In web sites your code files are also compiled dynamically by ASP.Net. So, ASP.Net is able to first compile the profiles and then add an accessor and reference to your page and compile it afterwards. In Web Application Projects your code files are compiled on the client. They can not have references to dynamically created assemblies that do not exist or they will not compile.
This is a general issue for ASP.Net BuildProviders and and Web Application Projects. We do not have a general solution yet. The two build providers we get the most questions about are App_GlobalResources and Profiles. For these two we are trying to come up with solutions. The thought is that we will generate proxy opjects that get compiled into your assembly on the client. The proxy objects for profiles will represent the state of the profiles in web.config at the time of compilation on the client. You will have strongly typed access to the profiles through the proxy. The proxy will work something like the sample code in the link above.
Tim McBride
This posting is provided "AS IS" with no warranties, and confers no rights.