Asp – Ambiguous Reference

asp.net

In my WAP project, every .aspx's code-behind and designer share the same namespace. For example my Main.Master.cs and Main.designer.cs are both in the OurCompany.Web namespace by default.

When I go to another .aspx page and use the following, I get an "Ambiguous reference" error because it can't decide if I'm talking about my code-behind or designer file of that master page

<%@ MasterType  TypeName="OurCompany.Web.Main" %>

but by default this is the way VS creates .aspx pages so should I really care?

Best Answer

The designer files are all marked as "partial" classes so they don't get compiled into their own types.

My guess is that you really do have 2 classes called "OurCompany.Web.Main". A tool like Reflector would let you browser your DLLs so you could tell for sure.