After transforming a Asp.internet web site to web application, I receive 'Type MyNameSpace.MyMaster isn't defined' error on pages which use the MasterType directive.

eg Within the aspx file

<%@ MasterType VirtualPath="~/MyMaster.master" %>

Within the designer.vb file the next code is produced and it has the mistake referred to above:

Public Shadows ReadOnly Property Master() As MyNameSpace.MyMaster

    Get

        Return CType(MyBase.Master, MyNameSpace.MyMaster)

    Finish Get

Finish Property

Basically take away the namespace the mistake disappears but this code is regenerated each time I create a switch to the aspx page.

Basically use TypeName with no namespace(eg Typename="MyMaster") rather than VirtualPath within the directive, the code is produced with no namespace reference and for that reason no error. However this fails at runtime rather. Such as the namespace reacts in the same manner as while using VirtualPath.

I think it has something related to alteration as new web application projects don't have this issue.

Any ideas what's going on here?

UPDATE:

Problem Solved!

In alteration I'd added a Namespace with similar title as my root Namespace to some class. Simply removed that to repair the problem.

You can namespace your masterpage class. Namespaces are produced automatically in web application projects.

namespace TestNS



    



Look at this to discover about every other gotchas:

http://msdn.microsoft.com/en-us/library/aa730880%28VS.80%29.aspx

Problem Solved!

In alteration I'd added a Namespace with similar title as my root Namespace to some class. Simply removed that to repair the problem.