Whenever you see such error while building websites, web applications or migration from previous versions to higher where mostly encounters.
Don’t panic it is pretty simple but needs attention.
The issue is only in one line of code where you find page directive.
To be more specific I mostly observe this error encountered because of inherits attribute of page directive tag of markup page.
For an instance, adding a aspx page to existing project having multiple directories like registration, sales, services, logs, geographies.
I need to add aspx page to geographies directory of web project. To do it I just right click on geographies directory and click add new item then give name to it and save.
Before you start execution have a look on page directive where you may find improper directive, may be as below:
<%language =vb code behind = page name. Aspx. Vb inherits =forex. Webapp. Pagename. Aspx%>
And this causes error as mentioned in title of post. To get rid of it, it is needed to verify the line as below
<%language =vb code behind = page name. Aspx. Vb inherits =forex. Webapp. Geographies. Pagename. Aspx%>
Hope it may be useful to other geeks.