Argh. What a silly error this is.
There are a couple of things that need to happen for this to happen in .net.
1. You precompiled your app (2.0)
2. You publish your site as ‘updateable’
3. You named a page that is the same as a Class in .net
Most developers call their login page: Login.aspx. When you publish it, the aspx is retained and tries to compile against Login’s codebeind, which won’t resolve properly in the assembly (due to System.Web.Login).
To avoid this, you need to ensure that your page names (classnames) don’t conflict with a type in System.Web
I might as well list page names as I find them that can’t be used.