I've just gone thru a large-ish project and renamed A LOT of namespace directives. Everything works fine on my developer box - deploy it to stage and I get:
Compiler Error Message: CS0433: The type 'ASP.usercontrols_pageheader_ascx' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\89252a5f\7305b927\App_Web_hodsbmv3.dll' and '
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\89252a5f\7305b927\App_Web_pageheader.ascx.6bb32623.bs4iljip.dll'
Yuck. Very similar to this: Deployment Project dlls cause ‘type x exists in both’ errors, but must be coming from a different cause.
I have none of the problems I've seen mentioned in other articles (App_Code / CodeFile directive). Worked out why it works on my machine: the website has no problem when it is in a vdir. If I remove the "PageHeader" usercontrol from the masterpage it lives on everthing is fine. If I rename "PageHeader" everything is fine. Updated: renaming the usercontrol doesn't help.
I'd had a look at the assemblies mentioned in the error in reflector; App_Web_hodsbmv3.dll
contains dynamic classes for all the usercontrols in my project. \App_Web_pageheader.ascx.6bb32623.bs4iljip.dll'
contains the same code just for the PageHeader usercontrol. Why would ASPX decide to create the same class in two assemblies?