Bootstrap FreeKB - Visual Studio - Resolve "parser error could not load type master page"
Visual Studio - Resolve "parser error could not load type master page"

Updated:   |  Visual Studio articles

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" 
%>

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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