Resolve error "parser error could not load type master page" in Visual Studio

Home > Search
  by

Let's say you create a new project in Visual studio, and create a website with a master page and a default.aspx page. After building the site and going to www.example.com/default.aspx, the parser error appears. Notice in this example the error references migrationdb.FrontEnd.

 

First, let's make sure that both the master page and default.aspx page are in the target directory. As an example, if the Web server is IIS and the directory is C:\inetpub\wwwroot\example, ensure the default.aspx and master page files are in the directory.

When first creating the project, you probably selected one of the following two:

  • ASP.NET Web Application
  • Website

If you selected ASP.NET Web Application, your default.aspx page will need to use CodeBehind (not CodeFile). If you selected Website, your default.aspx page will need to use CodeFile (not CodeBehind).

<%
@Page Title=Language="vb" 
AutoEventWireup="false" 
MasterPageFile="./MasterPages/FrontEnd.Master" 
CodeBehind="default.aspx.vb" 
Inherits="migrationdb._default" 
%>

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments