After converting a Asp.net website to web application, I receive 'Type MyNameSpace.MyMaster is not defined' error on pages that use the MasterType directive.
eg In the aspx file
<%@ MasterType VirtualPath="~/MyMaster.master" %>
In the designer.vb file the following code is generated and has the error described above:
Public Shadows ReadOnly Property Master() As MyNameSpace.MyMaster
Get
Return CType(MyBase.Master, MyNameSpace.MyMaster)
End Get
End Property
If I remove the namespace the error goes away but this code is regenerated every time I make a change to the aspx page.
If I use TypeName without the namespace(eg Typename="MyMaster") instead of VirtualPath in the directive, the code is generated without the namespace reference and therefore no error. However this fails at runtime instead. Including the namespace behaves in the same way as using the VirtualPath.
I am pretty sure this has something to do with the conversion process as new web application projects do not have this problem.
Any ideas what is going on here?
UPDATE:
Problem Solved!
In the conversion process I had added a Namespace with the same name as my root Namespace to a class. Simply removed that to fix the problem.