Resolve error "The file MasterPage.master does not exist"

Home > Search
  by

Let's say you are getting this error when attempting to view your default.aspx page in a browser. In Visual Studio, when looking at the code of the default.aspx page, notice the line MasterPageFile="~/example.Master".

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

 

Sometimes, changing the ~ (tilde) to a . (period) will resolve this error.

<%@ 
Page Title="" 
Language="vb" 
AutoEventWireup="false" 
MasterPageFile="./example.Master" 
CodeBehind="default.aspx.vb" 
Inherits="example._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